3

I'm writing a call recording component and I am testing it on HTC One M8.
the phone is not rooted, and I am using standrad API to record calls like in this example:

MediaRecorder recorder = new MediaRecorder();

recorder.setAudioSource(MediaRecorder.AudioSource.Default); //Also tried Voice Call

//Tried all combinations of the following 2 lines
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);

recorder.setAudioSamplingRate(44100); //Also tried 48000, 8000, 16000 etc
recorder.setOutputFile(OUTPUT_FILE_NAME_GOES_HERE);

recorder.prepare();
recorder.start();

I also tried with AudioRecord which is setup pretty much the same way, got same results.

Before upgrading to Lollipop I could hear both sides of the call very well. After the upgrade I can hear myself good, but the other side volume is very low.
I know some other apps are recording both sides of the call on HTC One M8 without root, so it is obviously something I'm missing.

Edit: please note that this worked before Lollipop and is still working on other devices on Lollipop, so I assume (of course I could easily be wrong) that something else - HTC M8 specific - is missing...

What could be applied so both sides can be heard?

Oren
  • 937
  • 1
  • 10
  • 34
  • 1
    Actually there is - create a MediaRecorder / AudioRecord with VOICE_CALL/DEFAULT/MIC etc audio sources, set parameters such as encoding, bit rate etc and start recording – Oren Mar 30 '15 at 18:08
  • 1
    Oren is correct. But Oren also forget to include his code. – 323go Mar 30 '15 at 18:11
  • You are right, could you add setup mediarecorder setup code maybe someone can check what is wrong with it... Without this it is hard to say – Selvin Mar 30 '15 at 18:19
  • I would also like to note that this worked before Lollipop and is working on another device I have (not HTC) with Lollipop, so maybe something else is missing... – Oren Mar 30 '15 at 18:26

1 Answers1

0

We are on the same boat Oren. My app stopped working too. Fe apps seems to be solved this issue without root but I was not able to do it. I am not sure if HTC has non public API for it

nLL
  • 5,662
  • 11
  • 52
  • 87
  • there are boldbeast,call recorder from skvalex and Total Call Recorder. All do it without root – nLL Apr 12 '15 at 20:02
  • I have tried all sorts of combinations with public API but was unable to record – nLL Apr 12 '15 at 20:04
  • Me too, but as we know it is possible it is just a matter of digging deep enough... – Oren Apr 12 '15 at 20:05