This is an interface class for the recording of audio.
More...
#include <recorder.h>
This is an interface class for the recording of audio.
Definition at line 57 of file recorder.h.
virtual bool Mezzanine::Audio::iRecorder::BeginRecording |
( |
) | |
|
|
pure virtual |
Starts recording audio from the initialized device.
- Note
- If there is any old data from previous recordings in the buffer, they will be wiped. You should call iRecorder::GetRecordedAudio before calling this.
- Returns
- Returns true if recording was successfully started.
virtual BitConfig Mezzanine::Audio::iRecorder::GetBitConfiguration |
( |
) | |
const |
|
pure virtual |
Gets the bit configuration for the audio captured by this recorder.
- Returns
- Returns an BitConfig representing the bit format for the audio recorded.
virtual UInt32 Mezzanine::Audio::iRecorder::GetBufferSize |
( |
) | |
const |
|
pure virtual |
Gets the size of the buffer storing the recorded audio.
- Returns
- Returns a UInt32 representing the current size of the recorder buffer.
virtual String Mezzanine::Audio::iRecorder::GetDeviceName |
( |
) | |
const |
|
pure virtual |
Gets the name of the currently set recording device.
- Returns
- Returns a String containing the name of the device this recorder was initialized with, or an empty string if one hasn't been initialized.
virtual UInt32 Mezzanine::Audio::iRecorder::GetFrequency |
( |
) | |
const |
|
pure virtual |
Gets the frequency of the captured audio.
- Returns
- Returns a UInt32 containing the frequency of the captured audio in Hz.
virtual UInt32 Mezzanine::Audio::iRecorder::GetInternalBufferSize |
( |
) | |
const |
|
pure virtual |
Gets the currently set size of the internal buffer in bytes.
- Returns
- Returns a UInt32 representing the internal size of the buffer in bytes.
virtual UInt32 Mezzanine::Audio::iRecorder::GetRecordedAudio |
( |
void * |
OutputBuffer, |
|
|
UInt32 |
OutputBufferSize |
|
) |
| |
|
pure virtual |
Writes the current contents of the recorder buffer to another buffer.
- Note
- This will clear the recorder buffer after being called.
- Parameters
-
OutputBuffer | A pointer to the buffer to write to. |
OutputBufferSize | The available size of the OutputBuffer. |
- Returns
- Returns a UInt32 representing the number of bytes written to the OutputBuffer.
virtual UInt32 Mezzanine::Audio::iRecorder::GetSampleSize |
( |
) | |
const |
|
pure virtual |
Gets the size of a single sample of recorded audio data.
- Returns
- Returns a UInt32 representing the size of a sample from the recorder buffer.
virtual bool Mezzanine::Audio::iRecorder::Initialize |
( |
const String & |
DeviceName = "" , |
|
|
const UInt32 |
Freq = 22050 , |
|
|
const BitConfig |
Config = BC_16Bit_Mono , |
|
|
const UInt32 |
IntBufSize = 8192 |
|
) |
| |
|
pure virtual |
Initializes the recording device with the current configuration.
- Parameters
-
DeviceName | The name of the recording device to use when recording audio. If left empty this will use the default device. |
Freq | The frequency at which to record and store the audio data in Hz. |
Config | The bit configuration to record and store the audio data. See enum BitConfig for more information. |
IntBufSize | The size of the internal buffer to allocate for the recorded audio. |
- Returns
- Returns true if the device was successfully initialized, false if there was a problem.
virtual bool Mezzanine::Audio::iRecorder::IsReady |
( |
) | |
const |
|
pure virtual |
Gets whether or not the current Recorder configuration is ready to start recording audio.
- Returns
- Returns true if this Recorder is ready to start recording, false otherise.
virtual bool Mezzanine::Audio::iRecorder::SetBitConfiguration |
( |
const BitConfig |
Config) | |
|
|
pure virtual |
Sets the bit configuration to use when recording data to the internal buffer.
- Note
- If this recorder is already initialized, calling this method may re-initialize it and clear the recorded audio buffer in the process.
- Parameters
-
Config | The bit configuration to record and store the audio data. See enum BitConfig for more information. |
- Returns
- Returns true if there were no errors in setting the bit configuration, false if there was a problem.
virtual bool Mezzanine::Audio::iRecorder::SetDeviceName |
( |
const String & |
DeviceName) | |
|
|
pure virtual |
Sets the device to be used for recording by name.
- Note
- If this recorder is already initialized, calling this method may re-initialize it and clear the recorded audio buffer in the process.
- Parameters
-
DeviceName | The name of the device to use to record audio. |
- Returns
- Returns true if there were no errors in setting the device name, false if there was a problem.
virtual bool Mezzanine::Audio::iRecorder::SetFrequency |
( |
const UInt32 |
Freq) | |
|
|
pure virtual |
Sets the frequency then the recorded audio will have.
- Note
- If this recorder is already initialized, calling this method may re-initialize it and clear the recorded audio buffer in the process.
- Parameters
-
Freq | The frequency at which to record and store the audio data in Hz. |
- Returns
- Returns true if there were no errors in setting the frequency, false if there was a problem.
virtual bool Mezzanine::Audio::iRecorder::SetInternalBufferSize |
( |
const UInt32 |
Size) | |
|
|
pure virtual |
Sets the size of the internal buffer where the recorded audio may be placed.
- Parameters
-
Size | The size of the internal buffer in bytes. |
virtual void Mezzanine::Audio::iRecorder::Shutdown |
( |
) | |
|
|
pure virtual |
Shuts down and releases the recording device.
- Note
- If you wish to reuse this recorder after it has been shut down, you will need to reinitialize it.
The documentation for this class was generated from the following file:
- /home/sqeaky/Code/Mezzanine/Mezzanine/src/Audio/recorder.h