1

This is how i'm recording audio :-

    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    recorder.setOutputFile(audioFile.getAbsolutePath());

and to start recording :-

    recorder.start(); // Recording is now started

and to stop :

    recorder.stop(); // Recording is now stopped

But how to pause while recording, also searched in stackoverflow and developer site and i found that there is no api to pause the recording. But there are many apps in google play where pause option is available, so that means some work around has to be done.

One way can be using the same audio file and appending data to it.

But, can anyone help me with some code.... Thanks :)

Aamir Shah
  • 4,473
  • 8
  • 21
  • 28
  • It looks like someone has had similar problem (possible duplicate): http://stackoverflow.com/questions/7256826/android-pause-voice-recorder-and-resume – user35443 Jan 13 '13 at 17:56
  • ya, but no solutions ... :( – Aamir Shah Jan 13 '13 at 17:58
  • 1
    There is a solution of stopping, preparing and starting again, isn't it? – user35443 Jan 13 '13 at 17:59
  • sorry, but i cant find anything inside pause function :p – Aamir Shah Jan 13 '13 at 18:00
  • What about reading first(accepted and the only) answer? – user35443 Jan 13 '13 at 18:02
  • You could use the `AudioRecord` class instead. Then you could keep reading data while you're in a paused state and just throw the data away. But you'd have to do the compression yourself if you want compressed outout. – Michael Jan 13 '13 at 18:43
  • It seems there are no option for pausing.See http://stackoverflow.com/questions/8007682/how-to-pause-resume-a-recording-created-with-mediarecorder, http://stackoverflow.com/questions/7256826/android-pause-voice-recorder-and-resume – ridoy Jan 13 '13 at 19:01

1 Answers1

0

Once you are recording the only possible actions are stop and reset.

Android MediaRecorder class not provide pause functionality so, we can't pause Recording but stop recording is available.

patel
  • 830
  • 1
  • 11
  • 26