It's very basic, I start recording at the beginning of the program, and in each iteration, if a certain amount of time has past, I check the buffer. That's when I'd like to erase the buffer.
Anyways, I've tried your suggestion of creating my own SoundRecorder
class Analyser : public sf::SoundRecorder{
sf::Clock clock;
bool OnStart(){
clock.Reset();
return true;
}
bool OnProcessSamples (const sf::Int16 * Samples, std::size_t SamplesCount){
std::cout << "NumSamples: " << SamplesCount << " time: " << clock.GetElapsedTime() << std::endl;
return true;
}
};
And looks like the "OnProcessSamples" is getting executed every 0.1 seconds, no matter what sample rate I use. Is there a way of changing it? 0.1 is too much time, I need some more resolution.