Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call recording not working in marshmallow and above

Other end voice is not able to record. * All permissions are given. It is working perfectly on "One plus three" device and some other devices too.

mainly it is happening in Redmi 4a , Micromax Vdeo 4 and some other devices.

myRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
myRecorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS);
myRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
myRecorder.setAudioSamplingRate(48000);
myRecorder.setAudioEncodingBitRate(384000); 

can anyone help to that?

Thanks in advance

like image 706
Subaharan Vel Avatar asked Dec 04 '25 14:12

Subaharan Vel


1 Answers

Set your audio source as MediaRecorder.AudioSource.VOICE_CALL. But it may not work on all devices above marshmallow. We need android.permission.CAPTURE_AUDIO_OUTPUT permission for it to work on marshmallow devices. But it is granted to system apps only as of now.

like image 75
Rohit P Soman Avatar answered Dec 07 '25 04:12

Rohit P Soman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!