SoundBufferRecorder

Specialized SoundRecorder which stores the captured audio data into a sound buffer.

SoundBufferRecorder allows to access a recorded sound through a SoundBuffer, so that it can be played, saved to a file, etc.

It has the same simple interface as its base class (start(), stop()) and adds a function to retrieve the recorded sound buffer (getBuffer()).

As usual, don't forget to call the isAvailable() function before using this class (see SoundRecorder for more details about this).

Constructors

this
this()
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

getBuffer
const(SoundBuffer) getBuffer()

Get the sound buffer containing the captured audio data.

onProcessSamples
bool onProcessSamples(const(short)[] samples)

Process a new chunk of recorded samples.

onStart
bool onStart()

Start capturing audio data.

onStop
void onStop()

Stop capturing audio data.

Inherited Members

From SoundRecorder

sfPtr
sfSoundRecorder* sfPtr;
Undocumented in source.
~this
~this()
Undocumented in source.
start
void start(uint theSampleRate)

Start the capture. The sampleRate parameter defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality). This function uses its own thread so that it doesn't block the rest of the program while the capture runs. Please note that only one capture can happen at the same time.

stop
void stop()

Stop the capture.

sampleRate
uint sampleRate [@property getter]

Get the sample rate in samples per second.

isAvailable
bool isAvailable()

Check if the system supports audio capture.

onStart
bool onStart()

Start capturing audio data.

onProcessSamples
bool onProcessSamples(const(short)[] samples)

Process a new chunk of recorded samples.

onStop
void onStop()

Stop capturing audio data.

See Also

Meta

Authors

Laurent Gomila, Jeremy DeHaan