2

I am going to create a program that recording voice call but MediaRecorder.AudioSource.VOICE_CALL does not work. I think its not support on many phones.

I'm trying with MediaRecorder.AudioSource.MIC but it just records and upload voice. In another word record my voice on microphone!!!

And I'm trying with MediaRecorder.AudioSource.VOICE_COMMUNICATION but it has a bad sound.

Here is my sample code:

recorder = new MediaRecorder();
recorder.reset();
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
recorder.setOutputFile(mFileName);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
try {
  recorder.prepare();
} catch (IOException e) {
  Log.e("LOG", "prepare() failed");
}
recorder.start();

Please help me. Thank you.

Java_User
  • 1,303
  • 3
  • 27
  • 38
  • 1
    For the security reason, you can not do this. See https://stackoverflow.com/questions/2283208/is-it-possible-to-record-phone-calls-via-an-android-app – goodev Mar 05 '18 at 10:39

0 Answers0