|
cAudio 2.3.0
3d Audio Engine
|


Public Types | |
| enum | Events { ON_INIT , ON_UPDATE , ON_RELEASE , ON_BEGINCAPTURE , ON_ENDCAPTURE , ON_USERREQUESTEDBUFFER } |
Public Member Functions | |
| virtual bool | initialize (const char *deviceName=0x0, unsigned int frequency=22050, AudioFormats format=EAF_16BIT_MONO, unsigned int internalBufferSize=8192) |
| Initializes the capture device to the selected settings. | |
| virtual bool | isReady () |
| 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) |
| 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 () |
| 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 bool | isUpdateThreadRunning () |
| Returns if the thread used to update all Audio Capture Objects is running. | |
| virtual const char * | getDeviceName () |
| Returns the name of the audio device being used to capture audio. | |
| virtual unsigned int | getFrequency () |
| Returns the frequency that the captured audio will be at. | |
| virtual AudioFormats | getFormat () |
| Returns the format of the captured audio. | |
| virtual unsigned int | getInternalBufferSize () |
| Returns the internal OpenAL buffer size in bytes. | |
| virtual unsigned int | getSampleSize () |
| 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) |
| 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) |
| 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) |
| 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) |
| 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 () |
| Starts capturing audio data to an internal buffer. Will clear any old data in the buffer. | |
| virtual void | stopCapture () |
| Stops capturing audio data to an internal buffer. | |
| virtual unsigned int | getCapturedAudio (void *outputBuffer, unsigned int outputBufferSize) |
| Allows access to the audio data in the internal capture buffer. | |
| virtual AudioCaptureBuffer * | getCapturedAudioBuffer () |
| this method is the same as getCapturedAudio but it returns an managed CaptureBuffer | |
| virtual unsigned int | getCurrentCapturedAudioSize () |
| Returns the current size of the internal audio buffer in bytes. | |
| void | getAvailableDevices () |
| virtual void | registerEventHandler (ICaptureEventHandler *handler) |
| Registers a new event handler to this manager. | |
| virtual void | unRegisterEventHandler (ICaptureEventHandler *handler) |
| Removes the specified event handler from this manager. | |
| virtual void | unRegisterAllEventHandlers () |
| Removes all event handlers attached to this manager. | |
| 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 | 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 bool | isUpdateThreadRunning ()=0 |
| Returns if the thread used to update all Audio Capture Objects is running. | |
| 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 AudioCaptureBuffer * | getCapturedAudioBuffer ()=0 |
| this method is the same as getCapturedAudio but it returns an managed CaptureBuffer | |
| 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. | |
Public Member Functions inherited from cAudio::cMemoryOverride | |
| void * | operator new (size_t size, const char *file, int line, const char *function) |
| void * | operator new (size_t size) |
| void * | operator new (size_t size, void *pointer) |
| void * | operator new[] (size_t size, const char *file, int line, const char *function) |
| void * | operator new[] (size_t size) |
| void | operator delete (void *pointer) |
| void | operator delete (void *pointer, void *) |
| void | operator delete (void *pointer, const char *, int, const char *) |
| void | operator delete[] (void *pointer) |
| void | operator delete[] (void *pointer, const char *, int, const char *) |
| virtual void | run ()=0 |
Protected Member Functions | |
| virtual void | run () |
| bool | initOpenALDevice () |
| void | shutdownOpenALDevice () |
| bool | checkError () |
| ALenum | convertAudioFormatEnum (AudioFormats format) |
| void | signalEvent (Events sevent) |
Protected Attributes | |
| cAudioMutex | Mutex |
| IThread * | AudioThread |
| Our update thread. | |
| unsigned int | Frequency |
| AudioFormats | Format |
| unsigned int | InternalBufferSize |
| int | SampleSize |
| cAudioVector< char >::Type | CaptureBuffer |
| cAudioList< ICaptureEventHandler * >::Type | eventHandlerList |
| bool | Ready |
| bool | Capturing |
| cAudioString | DeviceName |
| ALCdevice * | CaptureDevice |
Definition at line 17 of file cAudioCapture.h.
| enum cAudio::cAudioCapture::Events |
Definition at line 21 of file cAudioCapture.h.
| cAudio::cAudioCapture::cAudioCapture | ( | ) |
Definition at line 17 of file cAudioCapture.cpp.
| cAudio::cAudioCapture::~cAudioCapture | ( | ) |
Definition at line 23 of file cAudioCapture.cpp.
|
virtual |
Starts capturing audio data to an internal buffer. Will clear any old data in the buffer.
Implements cAudio::IAudioCapture.
Definition at line 116 of file cAudioCapture.cpp.

|
protected |
Definition at line 254 of file cAudioCapture.cpp.
|
protected |
Definition at line 269 of file cAudioCapture.cpp.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 157 of file cAudioCapture.cpp.

|
virtual |
this method is the same as getCapturedAudio but it returns an managed CaptureBuffer
Implements cAudio::IAudioCapture.
Definition at line 150 of file cAudioCapture.cpp.
|
virtual |
Returns the current size of the internal audio buffer in bytes.
Implements cAudio::IAudioCapture.
Definition at line 174 of file cAudioCapture.cpp.
|
inlinevirtual |
Returns the name of the audio device being used to capture audio.
Implements cAudio::IAudioCapture.
Definition at line 42 of file cAudioCapture.h.
|
inlinevirtual |
Returns the format of the captured audio.
Implements cAudio::IAudioCapture.
Definition at line 44 of file cAudioCapture.h.
|
inlinevirtual |
Returns the frequency that the captured audio will be at.
Implements cAudio::IAudioCapture.
Definition at line 43 of file cAudioCapture.h.
|
inlinevirtual |
Returns the internal OpenAL buffer size in bytes.
Implements cAudio::IAudioCapture.
Definition at line 45 of file cAudioCapture.h.
|
inlinevirtual |
Returns the size of a "sample" of audio data. Useful for making sure you grab audio data at sample boundaries.
Implements cAudio::IAudioCapture.
Definition at line 46 of file cAudioCapture.h.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 223 of file cAudioCapture.cpp.

|
protected |
Definition at line 34 of file cAudioCapture.cpp.
|
inlinevirtual |
Returns true if the capture device is ready to be used. False may indicate an error with the current settings.
Implements cAudio::IAudioCapture.
Definition at line 34 of file cAudioCapture.h.
|
inlinevirtual |
Returns if the thread used to update all Audio Capture Objects is running.
Note: Will always return false if threading is disabled. The library automatically shuts down the thread if no Audio Capture objects exist and will restart the thread on creation of a new object.
Implements cAudio::IAudioCapture.
Definition at line 37 of file cAudioCapture.h.
|
virtual |
Registers a new event handler to this manager.
| handler | Pointer to an event handler to attach. |
Implements cAudio::IAudioCapture.
Definition at line 286 of file cAudioCapture.cpp.
|
protectedvirtual |
Implements cAudio::IThreadWorker.
Definition at line 28 of file cAudioCapture.cpp.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 214 of file cAudioCapture.cpp.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 188 of file cAudioCapture.cpp.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 180 of file cAudioCapture.cpp.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 205 of file cAudioCapture.cpp.
|
virtual |
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.
Implements cAudio::IAudioCapture.
Definition at line 75 of file cAudioCapture.cpp.
|
protected |
Definition at line 57 of file cAudioCapture.cpp.
|
protected |
Definition at line 307 of file cAudioCapture.cpp.
|
virtual |
Stops capturing audio data to an internal buffer.
Implements cAudio::IAudioCapture.
Definition at line 136 of file cAudioCapture.cpp.

|
virtual |
Removes all event handlers attached to this manager.
Implements cAudio::IAudioCapture.
Definition at line 302 of file cAudioCapture.cpp.
|
virtual |
Removes the specified event handler from this manager.
| handler | Pointer to an event handler to remove. |
Implements cAudio::IAudioCapture.
Definition at line 294 of file cAudioCapture.cpp.
|
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. |
Implements cAudio::IAudioCapture.
Definition at line 90 of file cAudioCapture.cpp.

|
protected |
Our update thread.
Definition at line 71 of file cAudioCapture.h.
|
protected |
Definition at line 81 of file cAudioCapture.h.
|
protected |
Definition at line 88 of file cAudioCapture.h.
|
protected |
Definition at line 85 of file cAudioCapture.h.
|
protected |
Definition at line 87 of file cAudioCapture.h.
|
protected |
Definition at line 82 of file cAudioCapture.h.
|
protected |
Definition at line 77 of file cAudioCapture.h.
|
protected |
Definition at line 76 of file cAudioCapture.h.
|
protected |
Definition at line 78 of file cAudioCapture.h.
|
protected |
Definition at line 68 of file cAudioCapture.h.
|
protected |
Definition at line 84 of file cAudioCapture.h.
|
protected |
Definition at line 79 of file cAudioCapture.h.