title: Problem with audio while recording video
body: <p>I am able to record video but I am not getting audio for that video.
  Can any one help me to record video&amp;audio at same time.
  my code is as follows:</p>
  
  <pre><code>mr = new MediaRecorder();
  mr.setAudioSource(MediaRecorder.AudioSource.MIC);
  mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
  mr.setVideoSource(MediaRecorder.VideoSource.DEFAULT);       
  mr.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
  mr.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
  mPreview = new Preview(RecordVideo.this,mr);
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  </code></pre>
  
  <p>when I put audioSource and audioEncoder its getting runtime error:
  log cat details are:</p>
  
  <pre><code>05-07 10:17:01.175: ERROR/MediaRecorder(22990): setAudioEncoder called in an invalid state(2)
  05-07 10:17:01.175: ERROR/AndroidRuntime(22990):     at android.media.MediaRecorder.setAudioEncoder(Native Method)
  </code></pre>
  
  <p>when I remove those audioSource and audioEncoder from code its working fine for video without audio.
  I need to have audio also with video
  thanks in advance:</p>