class sound_buffer_recorder :
OcsfmlAudio.sound_buffer_recorder allows to access a recorded sound through a OcsfmlAudio.sound_buffer, 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 (get_buffer).
As usual, don't forget to call the SoundRecorder.is_available() function before using this class (see OcsfmlAudio.SoundRecorder for more details about this).
if SoundRecorder.is_available ()
(* Record some audio data *)
let recorder = new sound_buffer_recorder in
recorder#start () ;
(* Get the buffer containing the captured audio data *)
let buffer = recorder#getBuffer in
(* Save it to a file (for example...) *)
method destroy :
method get_buffer :
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.