I am trying to make a call recording app and i am able to record audio perfectly in android versions < 5.1 but in version > 5.1 there is no voice from the other end only my voice is audible.This is the code
recorder = new MediaRecorder();
recorder.setOutputFile(f.getAbsolutePath());
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
recorder.prepare();
recorder.start();
I have googled a lot and found that MediaRecorder.AudioSource.VOICE_CALL
will solve the problem but this is not available for 3rd party apps and also on using this the recorder crashes.I also tried using permission android.permission.CAPTURE_AUDIO_OUTPUT
but the problem persisted.
But there are apps like Automatic Call Recorder, Call Recorder and many other apps which are able to record voice from both sides, again I have no idea how are they doing it.
Any idea how are they able to do it? Or there is any other way to record the audio during calling. Any help would be appreciated