Recorder.cpp
// check if there is incoming data waiting to be processed
// if so - see if the captured data vector has exceeded 32768-sample length
// if exceeded, remove the oldest data and make it 32768-sample size again
check if there is incoming data waiting to be processed
if so - see if the captured data vector has exceeded 32768-sample length
if exceeded, remove the oldest data and make it 32768-sample size again
check if there is incoming data waiting to be processed if so - see if the captured data vector has exceeded 32768 - sample length if exceeded remove the oldest data and make it 32768 - sample size again
void Audio::update()
{
	if(callbackJustExecuted)
	{
		if(captured.size()>RECORDER_BUFFER_SIZE)
		{
			int nRemove = captured.size() - RECORDER_BUFFER_SIZE;
			captured.erase(captured.begin(), captured.begin()+nRemove);
		}
		callbackJustExecuted = false;
	}
}
void Audio :: update ( ) { if ( callbackJustExecuted ) { if ( captured . size ( ) > RECORDER_BUFFER_SIZE ) { int nRemove = captured . size ( ) - RECORDER_BUFFER_SIZE ; captured . erase ( captured . begin ( ) , captured . begin ( ) + nRemove ) ; } callbackJustExecuted = false ; } }
check if there is incoming data waiting to be processed
if so - see if the captured data vector has exceeded 32768-sample length
if exceeded, remove the oldest data and make it 32768-sample size again
check if there is incoming data waiting to be processed if so - see if the captured data vector has exceeded 32768 - sample length if exceeded remove the oldest data and make it 32768 - sample size again
// cout << "captured data size = " << captured.size() << endl;