title: android: media recorder : start failed: -38
body: <p>Brief: How to check if voice recording is already running in background in some other app.</p>
  
  <p>Detail: if voice recording is already running in background from native app: Voice recorder.
  Now I have implemented voice recording as one of feature in my application.</p>
  
  <p>Problem: when i try recording in my app at the same time, it gives error :</p>
  
  <pre><code>  : E/MediaRecorder: start failed: -38
    : E/MyApp: [1162][com.sec.MyApp.multimedia.RecordMyVoice]java.lang.IllegalStateException
    : E/MyApp:    at android.media.MediaRecorder.start(Native Method)
    : E/MyApp:    at com.sec.MyApp.multimedia.RecordMyVoice.doInBackground(RecordMyVoice.java:100)
  </code></pre>
  
  <p>Code at 100th line in RecordMyVoice.java:</p>
  
  <pre><code>    mRecorder = new MediaRecorder();
      mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      mRecorder.setOutputFile(mFileName);
      mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
      mRecorder.prepare();
      mRecorder.start(); //code at 100th line
  </code></pre>
  
  <p>But problem is because already voice recording is running in background.
  Therefore is there any way to stop voice recording if its running in some other app.</p>
  
  <p>Any input would be of great help.</p>