lib.DSFML.soundbufferrecorder

$(U SoundBufferRecorder) allows to access a recorded sound through a $(SOUNDBUFFER_LINK), 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_LINK) for more details about this).

Members

Classes

SoundBufferRecorder
class SoundBufferRecorder

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

Examples

if (SoundBufferRecorder.isAvailable())
{
    // Record some audio data
    auto recorder = SoundBufferRecorder();
    recorder.start();
    ...
    recorder.stop();

    // Get the buffer containing the captured audio data
    auto buffer = recorder.getBuffer();

    // Save it to a file (for example...)
    buffer.saveToFile("my_record.ogg");
}

See Also

$(SOUNDRECORDER_LINK)

Meta