All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.sound.SPB
java.lang.Object
|
+----quicktime.util.QTByteObject
|
+----quicktime.sound.SPB
- public final class SPB
- extends QTByteObject
- implements QuickTimeLib
The SPB class is used in conjunction with a SPBDevice to record sound.
It contains fields that describe how much sound the device should record
and a buffer of memory where the recorded sound is recorded.
-
kNativeSize
- This is the size (the number of bytes) that are required for this class
-
SPB(SPBDevice, int, int, QTPointerRef)
- Create a SPB.
-
getBuffer()
- Sets the buffer that the device will record into.
-
getBufferLength()
- Get the number of bytes that are or were recorded.
-
getCount()
- Get the number of bytes that are or were recorded.
-
getDevice()
- Gets the device that is attached to this object.
-
getError()
- You can call this to check the value of the error code.
-
getMilliseconds()
- Get the the number of milliseconds that are or were recorded.
-
isRecording()
- The status of the recording.
-
meterLevel()
- The level of the meter.
-
pauseRecording()
- Pause recording from a sound input device.
-
record(boolean)
- Record audio data into memory, either synchronously or asynchronously.
-
resumeRecording()
- Pause recording from a sound input device.
-
setBuffer(QTPointerRef)
- Sets the buffer that the device will record into.
-
setCount(int)
- Sets the number of bytes that are to be recorded.
-
setMilliseconds(int)
- Sets the the number of milliseconds that are to be recorded.
-
stopRecording()
- End a recording from a sound input device.
kNativeSize
public static final int kNativeSize
- This is the size (the number of bytes) that are required for this class
SPB
public SPB(SPBDevice device,
int count,
int milliseconds,
QTPointerRef buffer)
- Create a SPB.
- Parameters:
- device - the SPBDevice that is to be used for recording the sound
- count - how many bytes of data to record
- milliseconds - On input, the number of milliseconds to record. If this field indicates a longer recording time than the count field, then the count field is ignored.
- buffer - A QTPointer to the buffer for the sampled-sound data. If this buffer length is too small to contain the amount of sampled-sound data specified in the count and milliseconds fields, then recording time is truncated so that the sampled-sound data fits in the buffer.
getCount
public int getCount()
- Get the number of bytes that are or were recorded.
- Returns:
- number of bytes
setCount
public void setCount(int count)
- Sets the number of bytes that are to be recorded.
- Parameters:
- count - number of bytes
getBufferLength
public int getBufferLength()
- Get the number of bytes that are or were recorded.
- Returns:
- number of bytes
getMilliseconds
public int getMilliseconds()
- Get the the number of milliseconds that are or were recorded.
- Returns:
- number of milliseconds
setMilliseconds
public void setMilliseconds(int msecs)
- Sets the the number of milliseconds that are to be recorded.
- Parameters:
- msecs - milliseconds
getDevice
public SPBDevice getDevice()
- Gets the device that is attached to this object.
- Returns:
- the SPBDevice
setBuffer
public void setBuffer(QTPointerRef buffer)
- Sets the buffer that the device will record into.
- Parameters:
- buffer - the record buffer
getBuffer
public QTPointerRef getBuffer()
- Sets the buffer that the device will record into.
- Parameters:
- buffer - the record buffer
getError
public short getError()
- You can call this to check the value of the error code.
An error code > 0 means that an Async recording is still occuring.
An error code == 0 means no recording and no error.
An error code < 0 means that an error has occured and recording is terminated.
record
public void record(boolean flag) throws SoundException
- Record audio data into memory, either synchronously or asynchronously.
The sound is recorded into the specified buffer. If it is recorded
synchronously then the error code will be checked and an exception thrown
if required. If recorded asynchronously then the application will need to
check for errors after the recording has completed with the checkError code.
After recording the buffer contains the recorded bytes, the count how many
bytes were recorded, the milliseconds how many milliseconds of sound were
recorded based on the current settings of the device.
QuickTime::SPBRecord
- Parameters:
- flag - if true record asynchronously, if false records synchronously.
pauseRecording
public void pauseRecording() throws SoundException
- Pause recording from a sound input device.
QuickTime::SPBPauseRecording
resumeRecording
public void resumeRecording() throws SoundException
- Pause recording from a sound input device.
QuickTime::SPBResumeRecording
stopRecording
public void stopRecording() throws SoundException
- End a recording from a sound input device. If you call the checkError
instance method you will get an abortErr exception which indicates
that the recording was stopped by calling this method.
QuickTime::SPBStopRecording
isRecording
public boolean isRecording() throws SoundException
- The status of the recording.
While the input device is recording, this call returns true.
When a recording terminates without an error, this call false.
When an error occurs during recording or the recording has been terminated
by a call to the SPBStopRecording function (abortErr), this call throws an exception.
QuickTime::SPBGetRecordingStatus
meterLevel
public short meterLevel() throws SoundException
- The level of the meter.
While the input device is recording, this call returns the level.
QuickTime::SPBGetRecordingStatus
All Packages Class Hierarchy This Package Previous Next Index