Specialized SoundRecorder which stores the captured audio data into a sound buffer.
1 if (SoundBufferRecorder.isAvailable()) 2 { 3 // Record some audio data 4 auto recorder = SoundBufferRecorder(); 5 recorder.start(); 6 ... 7 recorder.stop(); 8 9 // Get the buffer containing the captured audio data 10 auto buffer = recorder.getBuffer(); 11 12 // Save it to a file (for example...) 13 buffer.saveToFile("my_record.ogg"); 14 }
$(SOUNDRECORDER_LINK)
$(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).