7#include "cOpenALUtil.h"
9#include "cMemoryOverride.h"
10#include "IAudioCapture.h"
11#include "cSTLAllocator.h"
12#include "cAudioString.h"
27 ON_USERREQUESTEDBUFFER,
33 virtual bool initialize(
const char* deviceName = 0x0,
unsigned int frequency = 22050,
AudioFormats format = EAF_16BIT_MONO,
unsigned int internalBufferSize = 8192);
48 virtual bool setDevice(
const char* deviceName);
55 virtual unsigned int getCapturedAudio(
void* outputBuffer,
unsigned int outputBufferSize);
59 void getAvailableDevices();
73 bool initOpenALDevice();
74 void shutdownOpenALDevice();
76 unsigned int Frequency;
78 unsigned int InternalBufferSize;
81 cAudioVector<char>::Type CaptureBuffer;
82 cAudioList<ICaptureEventHandler*>::Type eventHandlerList;
87 cAudioString DeviceName;
88 ALCdevice* CaptureDevice;
92 void signalEvent(Events sevent);
Interface for capturing operations in the cAudio Engine.
Interface for recieving Capture Manager Events.
virtual bool beginCapture()
Starts capturing audio data to an internal buffer. Will clear any old data in the buffer.
virtual bool setDevice(const char *deviceName)
Sets the audio device . Will cause the capture device to be reinitialized. Calling while in use will ...
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 const char * getDeviceName()
Returns the name of the audio device being used to capture audio.
virtual void stopCapture()
Stops capturing audio data to an internal buffer.
virtual void shutdown()
Shuts down the capture device, clearing the internal buffer and setting the audio capture into an uni...
virtual unsigned int getFrequency()
Returns the frequency that the captured audio will be at.
virtual unsigned int getSampleSize()
Returns the size of a "sample" of audio data. Useful for making sure you grab audio data at sample bo...
virtual bool setFrequency(unsigned int frequency)
Sets the frequency that the captured audio will be at. Will cause the capture device to be reinitiali...
virtual void unRegisterEventHandler(ICaptureEventHandler *handler)
Removes the specified event handler from this manager.
virtual bool setFormat(AudioFormats format)
Sets the format that the captured audio will be at. Will cause the capture device to be reinitialized...
virtual AudioCaptureBuffer * getCapturedAudioBuffer()
this method is the same as getCapturedAudio but it returns an managed CaptureBuffer
virtual AudioFormats getFormat()
Returns the format of the captured audio.
virtual unsigned int getInternalBufferSize()
Returns the internal OpenAL buffer size in bytes.
virtual bool setInternalBufferSize(unsigned int internalBufferSize)
Sets the internal buffer size that OpenAL will use to store captured audio between calls to getCaptur...
virtual bool isUpdateThreadRunning()
Returns if the thread used to update all Audio Capture Objects is running.
virtual unsigned int getCapturedAudio(void *outputBuffer, unsigned int outputBufferSize)
Allows access to the audio data in the internal capture buffer.
virtual void updateCaptureBuffer(bool force=false)
Grabs samples from the OpenAL buffer into the capture buffer if the OpenAL buffer has reached half fu...
virtual unsigned int getCurrentCapturedAudioSize()
Returns the current size of the internal audio buffer in bytes.
virtual bool isReady()
Returns true if the capture device is ready to be used. False may indicate an error with the current ...
virtual void unRegisterAllEventHandlers()
Removes all event handlers attached to this manager.
virtual void registerEventHandler(ICaptureEventHandler *handler)
Registers a new event handler to this manager.
IThread * AudioThread
Our update thread.
Overrides the memory allocations for classes derived from it and makes them use the cAudio memory sys...
Main namespace for the entire cAudio library.
AudioFormats
Enumeration of audio formats supported by the engine.