- 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).
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.
Read-only access to the sound buffer
- protected bool onStart();
- Start capturing audio data.
True to start the capture, or false to abort it
- protected bool onProcessSamples(const(short) samples);
- Process a new chunk of recorded samples.
const(short) samples Array of the new chunk of recorded samples'
True to continue the capture, or false to stop it
- protected void onStop();
- Stop capturing audio data.
Reimplemented from SoundRecorder.