mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Fixing error in Audio Handler
This commit is contained in:
parent
1cba136717
commit
371ae6e489
@ -1,6 +1,7 @@
|
||||
package com.phonegap.demo;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
@ -34,7 +35,15 @@ public class AudioHandler implements OnCompletionListener, OnPreparedListener, O
|
||||
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
|
||||
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
|
||||
recorder.setOutputFile(this.recording);
|
||||
recorder.prepare();
|
||||
try {
|
||||
recorder.prepare();
|
||||
} catch (IllegalStateException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
isRecording = true;
|
||||
recorder.start();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user