28#include <SFML/Audio/SoundBufferRecorder.hpp>
38bool SoundBufferRecorder::OnStart()
49bool SoundBufferRecorder::OnProcessSamples(
const Int16* Samples, std::size_t SamplesCount)
51 std::copy(Samples, Samples + SamplesCount, std::back_inserter(mySamples));
60void SoundBufferRecorder::OnStop()
62 if (!mySamples.empty())
63 myBuffer.LoadFromSamples(&mySamples[0], mySamples.size(), 1,
GetSampleRate());
const SoundBuffer & GetBuffer() const
Get the sound buffer containing the captured audio data.
SoundBuffer is the low-level for loading and manipulating sound buffers.
unsigned int GetSampleRate() const
Get the sample rate.