View on GitHub

DSFML

dsfml.audio.soundbufferrecorder



class SoundBufferRecorder: dsfml.audio.soundrecorder.SoundRecorder;
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).

See Also:


http:
//www.sfml-dev.org/documentation/2.0/classsf_1_1SoundBufferRecorder.php#details

Authors:
Laurent Gomila, Jeremy DeHaan

const const(SoundBuffer) getBuffer();
Get the sound buffer containing the captured audio data.

The sound buffer is valid only after the capture has ended. This function provides a read-only access to the internal sound buffer, but it can be copied if you need to make any modification to it.

Returns:
Read-only access to the sound buffer

protected bool onStart();
Start capturing audio data.

Returns:
True to start the capture, or false to abort it

protected bool onProcessSamples(const(short)[] samples);
Process a new chunk of recorded samples.

Params:
const(short)[] samples Array of the new chunk of recorded samples'

Returns:
True to continue the capture, or false to stop it

protected void onStop();
Stop capturing audio data.

Reimplemented from SoundRecorder.