Android Recording Incoming and Outgoing Calls

Viewed 56419

I am trying to understand is there a way I can record calls incoming and outgoing on android phones 2.2 and above?

A client wants to record calls of the agents they make to the clients so that it can be later used to fill out some material. Instead of making the client wait while on call they want to do it later on.

Is this possible and what APIs do I need to use?

4 Answers

I am using mic to record phone audio and also use the Telephony manager to find the calling state.

private MediaRecorder recorder;

  recorder = new MediaRecorder();
        try {
            recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION);
            recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
            recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
            recorder.setAudioSamplingRate(44100);
            recorder.setOutputFile(your_desired_files_absoulte_path);
} catch (Exception e) {
e.printstacktrace ;
}

after that, you can easily start recording anywhere you want

recorder.prepare();
recorder.start();

and after finishing recording you can easily also stop the recording

recorder.stop();
recorder.reset();
recorder.release();

to record just hit the menu button while in call in android phone it will store conversation in amr format and in root directory of sd card max 20min conversation.

Related