I create the application like this:
The code for beginning recording
public static void startRecording() {
if (recordTime == 0) {
if (null == mr) {
mr = new MediaRecorder();
}
path = new File(Environment.getExternalStorageDirectory(),
"myRecording.3gp");
mr.reset();
Get the ΪMicphone music volime
mr.setAudioSource(MediaRecorder.AudioSource.MIC);
mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mr.setOutputFile(path.getAbsolutePath());
mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
try {
mr.prepare();
} catch (IOException e) {
}
mr.start();
Record.recordTime = 1;
}
}
End recording
public static void stopRecording() {
if (mr != null) {
// mr.reset();
mr.stop();
mr.release();
mr = null;
Record.recordTime = 0;
}
}
I repeated fast call recording
I call the recording fast repeatedly and stop the recording process, it will appear ANR phenomenon.
Who knows what the problem is?
Thanks in advance!