2

I have tried AudioSource VOICE_CALL,DEFAULT,VOICE_COMMUNICATION,MIC I am not able to get the other side voice only on Nougat devices, rest of working fine. I dont know where I am facing problem in Nougat. My Code is below

           recorder = new MediaRecorder();
             if (audioManager.isSpeakerphoneOn()) {
                recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
             } else if (!audioManager.isSpeakerphoneOn()) {
                recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
             }
             recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
             recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

I want to know is it possible and will it be implemented to record calls on Android 7?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Faiz
  • 21
  • 2

1 Answers1

0

You need to request the CAPTURE_AUDIO_OUTPUT permission.

From https://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html

Capturing from VOICE_CALL source requires the CAPTURE_AUDIO_OUTPUT permission.

warsong
  • 1,008
  • 2
  • 12
  • 21