Fixed bug in audio recorder
This commit is contained in:
@@ -254,12 +254,17 @@ class AudioThread
|
|||||||
int got = mRecorder.read(mRecordBuffer, 0, mRecordBuffer.length);
|
int got = mRecorder.read(mRecordBuffer, 0, mRecordBuffer.length);
|
||||||
if( got != mRecordBuffer.length )
|
if( got != mRecordBuffer.length )
|
||||||
{
|
{
|
||||||
System.out.println("SDL: warning: RecordingThread: mRecorder.read returned short byte count " + got + " for bufsize " + mRecordBuffer.length);
|
// Audio is stopped here, sleep a bit.
|
||||||
// TODO: record in a loop?
|
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;
|
stopped = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user