Fixed bug in audio recorder

This commit is contained in:
Sergii Pylypenko
2013-03-19 19:57:38 +02:00
parent c0c1663f2f
commit 08e24c12c0

View File

@@ -254,12 +254,17 @@ class AudioThread
int got = mRecorder.read(mRecordBuffer, 0, mRecordBuffer.length);
if( got != mRecordBuffer.length )
{
System.out.println("SDL: warning: RecordingThread: mRecorder.read returned short byte count " + got + " for bufsize " + mRecordBuffer.length);
// TODO: record in a loop?
// Audio is stopped here, sleep a bit.
try{
Thread.sleep(1000);
} catch (InterruptedException e) {}
}
else
{
//System.out.println("SDL: nativeAudioRecordCallback with len " + mRecordBuffer.length);
nativeAudioRecordCallback();
//System.out.println("SDL: nativeAudioRecordCallback returned");
}
//System.out.println("SDL: nativeAudioRecordCallback with len " + mRecordBuffer.length);
nativeAudioRecordCallback();
//System.out.println("SDL: nativeAudioRecordCallback returned");
}
stopped = true;