Permalink
Browse files

Fixed bug in audio recorder

  • Loading branch information...
1 parent c0c1663 commit 08e24c12c07df251ca0aa6d8579c3569fc524c7e @pelya committed Mar 19, 2013
Showing with 10 additions and 5 deletions.
  1. +10 −5 project/java/Audio.java
View
@@ -254,12 +254,17 @@ public void run()
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;

0 comments on commit 08e24c1

Please sign in to comment.