title: MediaRecorder does not record both side audio recordings in android
body: <p>I am not able to record audio of both side in android. only one side audio is recording using below code. is both side audio recording is possible in android?</p>
  
  <p>public class CallRecordingService extends Service {</p>
  
  <pre><code>private MediaPlayer mPlayer = null;
  private MediaRecorder mRecorder = null;
  private static final String LOG_TAG = CallRecordingService.class.getSimpleName();
  private String savingPath;
  boolean isRecordStarted = false;
  
  @Nullable
  @Override
  public IBinder onBind(Intent intent) {
      return null;
  }
  
  @Override
  public void onCreate() {
      super.onCreate();
  }
  
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
      super.onStartCommand(intent, flags, startId);
      savingPath = intent.getStringExtra("OUTPUT_PATH");
      AppApplication.getInstance().saveIntoPrefs(MConstants.RECORDING_FILE_PATH, savingPath);
      startRecording();
      return START_NOT_STICKY;
  }
  
  // this process must be done prior to the start of recording
  private void resetRecorder() {
      mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN) {
          mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
          mRecorder.setAudioEncodingBitRate(48000);
      } else {
          mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
          mRecorder.setAudioEncodingBitRate(64000);
      }
      mRecorder.setAudioSamplingRate(8000);
      mRecorder.setOutputFile(savingPath);
  
      try {
          mRecorder.prepare();
      } catch (IllegalStateException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  private void startRecording() {
      if (mRecorder != null) {
          mRecorder.stop();
          mRecorder.release();
      }
      mRecorder = new MediaRecorder();
      resetRecorder();
      try {
          // Sometimes prepare takes some time to complete
          Thread.sleep(2000);
          if (!isRecordStarted) {
              mRecorder.start();
              isRecordStarted = true;
          } else if (isRecordStarted) {
              isRecordStarted = false;
              stopRecording();
          }
      } catch (InterruptedException | IllegalStateException e) {
          e.printStackTrace();
      }
  }
  
  public void stopRecording() {
      if (mRecorder != null) {
          mRecorder.stop();
          mRecorder.reset();
          mRecorder.release();
          mRecorder = null;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am stuck to implement this recording feature in my application. If anyone has completed such kind of implementation then plz address my mistake.</p>