Media Recorder To record calls is sometime unable to Record other side voice
Asked Answered
P

1

13

In my application there is a feature to record voice calls and it works perfectly well. But when tested on (Samsung s7, s8 ) it doesn’t work well. The application is able to record only callers voice not the voice from the other end. Below is my code to check please suggest a solution

MediaRecd = new MediaRecorder();
            MediaRecd.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL
            );

            MediaRecd.setAudioChannels(ConstantVariables.audioChannels);//monoRecording

   MediaRecd.setAudioEncodingBitRate(64);
            MediaRecd.setAudioSamplingRate(44100);


            MediaRecd.setOutputFormat(output_formats[pos]);//.mp3
            MediaRecd.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);//I already try with all possible CAMCORDER , MIC , Default etc etc but none was working
            MediaRecd.setOutputFile(Currentfilename);

            try {
                MediaRecd.prepare();
                MediaRecd.start();


            } catch (Exception e) {
                MediaRecd.reset();
                MediaRecd.release();
                MediaRecd = null;

            }

Please help

Poach answered 25/8, 2017 at 12:0 Comment(18)
Same on my end...Outstretch
what solution you tried for this? currently i stuck in this problem.Poach
On which OS version it is not working?Chere
both S7 and S8 have OS 7 versionPoach
tried to use my below answer approach and update.Chere
No bro its not working i already did this but S7 and S8 didnt get other side voice.Poach
check on other manufacture with same OSChere
I checked with Samsung S6 edge with OS 7 and it working perfectly and also I check with Nexus 6p OS 7 also its working perfectlyPoach
try these two also VOICE_DOWNLINK and VOICE_UPLINK. Ideally you should keep all the sources in an array and try each of them out one during some kind of a setup and ask the user which one works. then choose the one that the user approved.Kinetics
@Manas Dadheech I already did with all the Methods from Media Recorder class and audio Recorder class but i think this is something else which I can't found yet.Poach
@BhanuSharma i am also stuck with the same problem , i am also having S7 edge... were you able to resolve this issue? lets discuss over chat?Emmenagogue
@japanjotsingh i still stuck in samePoach
@BhanuSharma Did you find the solution?Warm
No still not found..Poach
Hi BhanuSharma, I am also trying to record incoming and outgoing calls but unable to record. I am working on it from 2 days but it is not working.I am using MediaRecorder when ever call started but not working.Please help me on this.Allantoid
@Allantoid Have u got success on any mobile because in my case I failed on Samsung S7 and more of its successor. My prob was I was not able to record other side's voice in some mobile, not eachPoach
Hi Bhanu Sharma, I cannot able to record the voice on the other side in all cases.Actually I have tried the code in Lollipop(Below Marshmallow), Pie(Above Marshmallow).It failed in all the cases.Can you help me on this please ?Allantoid
@BhanuSharma VOICE_CALL permission is only for system apps, did you check?Aitch
C
-1

AudioSource.VOICE_CALL is not working in some android devices so instead of VOICE_CALL use below

First try MediaRecorder.AudioSource.CAMCORDER

 MediaRecd = new MediaRecorder();
        MediaRecd.setAudioSource(MediaRecorder.AudioSource.CAMCORDER
        );

If above is not working than use MediaRecorder.AudioSource.MIC

MediaRecd = new MediaRecorder();
        MediaRecd.setAudioSource(MediaRecorder.AudioSource.MIC
        );
Chere answered 4/9, 2017 at 7:14 Comment(1)
NO its not working @Vishal I already did this think but Samsung S7 and S8 doesn't work from thesePoach

© 2022 - 2024 — McMap. All rights reserved.