Interface for capturing operations in the cAudio Engine. More...
#include <IAudioCapture.h>

Public Member Functions | |
| virtual bool | initialize (const char *deviceName=0x0, unsigned int frequency=22050, AudioFormats format=EAF_16BIT_MONO, unsigned int internalBufferSize=8192)=0 |
| Initializes the capture device to the selected settings. | |
| virtual bool | isSupported ()=0 |
| Returns true if the current OpenAL implementation supports capturing audio. | |
| virtual bool | isReady ()=0 |
| Returns true if the capture device is ready to be used. False may indicate an error with the current settings. | |
| virtual void | updateCaptureBuffer (bool force=false)=0 |
| Grabs samples from the OpenAL buffer into the capture buffer if the OpenAL buffer has reached half full. Should be run once every audio frame, unless threading is enabled. | |
| virtual void | shutdown ()=0 |
| Shuts down the capture device, clearing the internal buffer and setting the audio capture into an uninitialized state. You must call initialize() again in order to reuse this object. | |
| virtual const char * | getAvailableDeviceName (unsigned int index)=0 |
| Returns the name of an available capture device. | |
| virtual unsigned int | getAvailableDeviceCount ()=0 |
| Returns the number of capture devices available for use. | |
| virtual const char * | getDefaultDeviceName ()=0 |
| Returns the name of the default system playback device. | |
| virtual const char * | getDeviceName ()=0 |
| Returns the name of the audio device being used to capture audio. | |
| virtual unsigned int | getFrequency ()=0 |
| Returns the frequency that the captured audio will be at. | |
| virtual AudioFormats | getFormat ()=0 |
| Returns the format of the captured audio. | |
| virtual unsigned int | getInternalBufferSize ()=0 |
| Returns the internal OpenAL buffer size in bytes. | |
| virtual unsigned int | getSampleSize ()=0 |
| Returns the size of a "sample" of audio data. Useful for making sure you grab audio data at sample boundaries. | |
| virtual bool | setDevice (const char *deviceName)=0 |
| Sets the audio device . Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer. | |
| virtual bool | setFrequency (unsigned int frequency)=0 |
| Sets the frequency that the captured audio will be at. Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer. | |
| virtual bool | setFormat (AudioFormats format)=0 |
| Sets the format that the captured audio will be at. Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer. | |
| virtual bool | setInternalBufferSize (unsigned int internalBufferSize)=0 |
| Sets the internal buffer size that OpenAL will use to store captured audio between calls to getCapturedAudio() in bytes. Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer. | |
| virtual bool | beginCapture ()=0 |
| Starts capturing audio data to an internal buffer. Will clear any old data in the buffer. | |
| virtual void | stopCapture ()=0 |
| Stops capturing audio data to an internal buffer. | |
| virtual unsigned int | getCapturedAudio (void *outputBuffer, unsigned int outputBufferSize)=0 |
| Allows access to the audio data in the internal capture buffer. | |
| virtual unsigned int | getCurrentCapturedAudioSize ()=0 |
| Returns the current size of the internal audio buffer in bytes. | |
| virtual void | registerEventHandler (ICaptureEventHandler *handler)=0 |
| Registers a new event handler to this manager. | |
| virtual void | unRegisterEventHandler (ICaptureEventHandler *handler)=0 |
| Removes the specified event handler from this manager. | |
| virtual void | unRegisterAllEventHandlers ()=0 |
| Removes all event handlers attached to this manager. | |
Interface for capturing operations in the cAudio Engine.
Definition at line 15 of file IAudioCapture.h.
| virtual bool cAudio::IAudioCapture::beginCapture | ( | ) | [pure virtual] |
Starts capturing audio data to an internal buffer. Will clear any old data in the buffer.
Implemented in cAudio::cAudioCapture.
| virtual unsigned int cAudio::IAudioCapture::getAvailableDeviceCount | ( | ) | [pure virtual] |
Returns the number of capture devices available for use.
Implemented in cAudio::cAudioCapture.
| virtual const char* cAudio::IAudioCapture::getAvailableDeviceName | ( | unsigned int | index | ) | [pure virtual] |
Returns the name of an available capture device.
| index,: | Specify which name to retrieve ( Range: 0 to getAvailableDeviceCount()-1 ). |
Implemented in cAudio::cAudioCapture.
| virtual unsigned int cAudio::IAudioCapture::getCapturedAudio | ( | void * | outputBuffer, | |
| unsigned int | outputBufferSize | |||
| ) | [pure virtual] |
Allows access to the audio data in the internal capture buffer.
Can be called at any time to retrieve recorded audio. It is recommended that you call it every so often with long recordings to prevent the internal buffer from growing too large. Once successfully retrieved, the captured audio will be deleted from the internal buffer.
| outputBuffer,: | Pointer to an output array to copy audio data to. | |
| outputBufferSize,: | Size of the output array in bytes. |
Implemented in cAudio::cAudioCapture.
| virtual const char* cAudio::IAudioCapture::getDefaultDeviceName | ( | ) | [pure virtual] |
Returns the name of the default system playback device.
Implemented in cAudio::cAudioCapture.
| virtual unsigned int cAudio::IAudioCapture::getInternalBufferSize | ( | ) | [pure virtual] |
Returns the internal OpenAL buffer size in bytes.
Implemented in cAudio::cAudioCapture.
| virtual unsigned int cAudio::IAudioCapture::getSampleSize | ( | ) | [pure virtual] |
Returns the size of a "sample" of audio data. Useful for making sure you grab audio data at sample boundaries.
Implemented in cAudio::cAudioCapture.
| virtual bool cAudio::IAudioCapture::initialize | ( | const char * | deviceName = 0x0, |
|
| unsigned int | frequency = 22050, |
|||
| AudioFormats | format = EAF_16BIT_MONO, |
|||
| unsigned int | internalBufferSize = 8192 | |||
| ) | [pure virtual] |
Initializes the capture device to the selected settings.
Note that calling this will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer.
| deviceName,: | Name of the audio device to capture audio from, pass NULL to specify the default one. | |
| frequency,: | Frequency that the captured audio will be captured at in hertz. | |
| format,: | Format of the captured audio. | |
| internalBufferSize,: | Size of the internal OpenAL buffer used to store the captured audio between calls to getCapturedAudio() in bytes. |
Implemented in cAudio::cAudioCapture.
| virtual void cAudio::IAudioCapture::registerEventHandler | ( | ICaptureEventHandler * | handler | ) | [pure virtual] |
Registers a new event handler to this manager.
| handler,: | Pointer to an event handler to attach. |
Implemented in cAudio::cAudioCapture.
| virtual bool cAudio::IAudioCapture::setDevice | ( | const char * | deviceName | ) | [pure virtual] |
Sets the audio device . Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer.
| deviceName,: | Name of the audio device to capture audio from, pass NULL to specify the default one. |
Implemented in cAudio::cAudioCapture.
| virtual bool cAudio::IAudioCapture::setFormat | ( | AudioFormats | format | ) | [pure virtual] |
Sets the format that the captured audio will be at. Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer.
| format,: | Format of the captured audio. |
Implemented in cAudio::cAudioCapture.
| virtual bool cAudio::IAudioCapture::setFrequency | ( | unsigned int | frequency | ) | [pure virtual] |
Sets the frequency that the captured audio will be at. Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer.
| frequency,: | Frequency that the captured audio will be captured at in hertz. |
Implemented in cAudio::cAudioCapture.
| virtual bool cAudio::IAudioCapture::setInternalBufferSize | ( | unsigned int | internalBufferSize | ) | [pure virtual] |
Sets the internal buffer size that OpenAL will use to store captured audio between calls to getCapturedAudio() in bytes. Will cause the capture device to be reinitialized. Calling while in use will clear the internal audio buffer.
| internalBufferSize,: | Size of the internal OpenAL buffer in bytes. |
Implemented in cAudio::cAudioCapture.
| virtual void cAudio::IAudioCapture::unRegisterEventHandler | ( | ICaptureEventHandler * | handler | ) | [pure virtual] |
Removes the specified event handler from this manager.
| handler,: | Pointer to an event handler to remove. |
Implemented in cAudio::cAudioCapture.
| virtual void cAudio::IAudioCapture::updateCaptureBuffer | ( | bool | force = false |
) | [pure virtual] |
Grabs samples from the OpenAL buffer into the capture buffer if the OpenAL buffer has reached half full. Should be run once every audio frame, unless threading is enabled.
| force,: | Force capturing data from the buffer, even if the buffer is not half full. |
Implemented in cAudio::cAudioCapture.
1.6.2