Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | List of all members
Mezzanine::Audio::iRecorder Class Referenceabstract

This is an interface class for the recording of audio. More...

#include <recorder.h>

Public Member Functions

 iRecorder ()
 Class constructor.
 
virtual ~iRecorder ()
 Class destructor.
 
virtual Boole BeginRecording ()=0
 Starts recording audio from the initialized device. More...
 
virtual BitConfig GetBitConfiguration () const =0
 Gets the bit configuration for the audio captured by this recorder. More...
 
virtual UInt32 GetBufferSize () const =0
 Gets the size of the buffer storing the recorded audio. More...
 
virtual String GetDeviceName () const =0
 Gets the name of the currently set recording device. More...
 
virtual UInt32 GetFrequency () const =0
 Gets the frequency of the captured audio. More...
 
virtual UInt32 GetInternalBufferSize () const =0
 Gets the currently set size of the internal buffer in bytes. More...
 
virtual UInt32 GetRecordedAudio (void *OutputBuffer, UInt32 OutputBufferSize)=0
 Writes the current contents of the recorder buffer to another buffer. More...
 
virtual UInt32 GetSampleSize () const =0
 Gets the size of a single sample of recorded audio data. More...
 
virtual Boole Initialize (const String &DeviceName="", const UInt32 Freq=22050, const BitConfig Config=BC_16Bit_Mono, const UInt32 IntBufSize=8192)=0
 Initializes the recording device with the current configuration. More...
 
virtual Boole IsReady () const =0
 Gets whether or not the current Recorder configuration is ready to start recording audio. More...
 
virtual Boole SetBitConfiguration (const BitConfig Config)=0
 Sets the bit configuration to use when recording data to the internal buffer. More...
 
virtual Boole SetDeviceName (const String &DeviceName)=0
 Sets the device to be used for recording by name. More...
 
virtual Boole SetFrequency (const UInt32 Freq)=0
 Sets the frequency then the recorded audio will have. More...
 
virtual Boole SetInternalBufferSize (const UInt32 Size)=0
 Sets the size of the internal buffer where the recorded audio may be placed. More...
 
virtual void Shutdown ()=0
 Shuts down and releases the recording device. More...
 
virtual void StopRecording ()=0
 Stops the recording of audio if this is currently recording.
 

Detailed Description

This is an interface class for the recording of audio.

Definition at line 57 of file recorder.h.

Member Function Documentation

virtual Boole 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
OutputBufferA pointer to the buffer to write to.
OutputBufferSizeThe 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 Boole 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
DeviceNameThe name of the recording device to use when recording audio. If left empty this will use the default device.
FreqThe frequency at which to record and store the audio data in Hz.
ConfigThe bit configuration to record and store the audio data. See enum BitConfig for more information.
IntBufSizeThe 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 Boole 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 Boole 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
ConfigThe 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 Boole 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
DeviceNameThe 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 Boole 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
FreqThe 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 Boole Mezzanine::Audio::iRecorder::SetInternalBufferSize ( const UInt32  Size)
pure virtual

Sets the size of the internal buffer where the recorded audio may be placed.

Parameters
SizeThe size of the internal buffer in bytes.
Returns
Returns true if the internal buffer size was successfully updated, false otherwise.
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: