Question: ```
Recorder = new MediaRecorder();     
Recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 
Recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR); 
Recorder.setOutputFile(FileName); 
Recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

```

this is my Code and i am not able to record the voice of other person.so what should i use instead of AudioSorce.MIC.
plz help me

Answer: 
Sorry to disappoint you, but you can't, not in the general case. Most Android running phones have the wiring in hardware/firmware so that the media of the call does not pass through the application processor at all - it goes from the audio to the DSP and vice versa, so you cannot access it.

You can catch the audio of the person using the phone, but not the other way around, disregarding silly hacks like asking the person to use the speakers and recording the sound from there via the phone mic...
Try This code to record call.

```
AudioManager audioManager;
private MediaRecorder myAudioRecorder;
//Myservice m=new Myservice();
   private String outputFile = null;
   String uid=null;
   String no=null;
   String rname=null;

public void record(Context c,String no, String ser){
    try{
    this.no=no;
    uid=ser;
    rname=String.format("%d.mp3", System.currentTimeMillis());
    //rname="/#"+uid+"#"+rname;
     outputFile = Environment.getExternalStorageDirectory().toString() + "/Android/free"+"/#"+uid+"#"+no+"#"+rname;
      StartAudioSpeacker();
      myAudioRecorder=new MediaRecorder();
      myAudioRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      myAudioRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      myAudioRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
      myAudioRecorder.setOutputFile(outputFile);
      }catch(IllegalStateException e){e.printStackTrace();}
        try {
            myAudioRecorder.prepare();
             myAudioRecorder.start();
        } catch (IllegalStateException | IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

 }
 public void getc(Context c) {
    // TODO Auto-generated method stub
     this.c=c;

}
public void st()
 { //Toast.makeText(;, "recorded",Toast.LENGTH_LONG).show();
    try{
     myAudioRecorder.stop();
     myAudioRecorder.release();
     myAudioRecorder=null;
    }
    catch(IllegalStateException e)
    {
        e.printStackTrace(); 
    }
     Handler h=new Handler();
     h.postDelayed(new Runnable() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            try{
            uprecord ur=new uprecord("/#"+uid+"#"+no+"#"+rname);
             ur.tt();
            }catch(IllegalStateException e){e.printStackTrace();}   }
    }, 1000);

 }

 public void StartAudioSpeacker(){

         audioManager = (AudioManager) c.getSystemService(Context.AUDIO_SERVICE);
         audioManager.setSpeakerphoneOn(false);
         audioManager.setStreamVolume(AudioManager.MODE_IN_CALL, audioManager.getStreamMaxVolume(AudioManager.MODE_IN_CALL), 1);
         System.out.println("Speaker Volume :"+ audioManager.getStreamMaxVolume(AudioManager.MODE_IN_CALL));
         System.out.println("Is phone speaker : "+ audioManager.isSpeakerphoneOn());
 }

```

}