title: How to pause/resume a recording created with mediarecorder?
body: <p>I'm trying to pause a recording on an incoming call and resume it later. i'm using the andriod <code>mediarecorder</code> and trying to record in <code>MPEG4</code>. I tried pause/resume with resetting/stopping a recording and starting it with the <code>setOutputFile(fd)</code>, <code>fd</code> being the <code>filedescriptor</code> of the audio file that was stopped/paused and hoped it would append but i had no luck. Is there a way to achieve this or append two recordings or should i give up on <code>mediarecorder</code>.</p>
  
  <p><strong>code:</strong></p>
  
  <pre><code>private MediaRecorder media_recorder;
  private String file_path = null;
  
  public void startRecording(path)
  {
    file_path = path
    media_recorder= new MediaRecorder();
    media_recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    media_recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    media_recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    media_recorder.setOputputFile(path);
    media_recorder.prepare();
  }
  
  public void pauseRecording()
  {
    media_recorder.stop();
    media_recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    media_recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    media_recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    FileOutputStream paused_file = new FileOutputStream(file_path);
    media_recorder.setOutputFile(paused_file.getFD());
  }
  
  public void resumeRecording()
  {
    media_recorder.prepare();
    media_recorder.start();
  }
  </code></pre>
  
  <p><code>pauseRecording()</code> stops the recording but resume fails with message <code>start failed</code>.</p>