Search code examples
androidaudio-recordingsamsung-mobileandroid-mediarecorder

Sound recorder muted during phone call


My app records audio in amr format. It works pretty well on some devices but on others it fails to record audio during a phone call. From the recorded file you can clearly tell that the recording is ok and you hear everything until the moment the phone starts ringing and from there the audio is muted.

This is observed on a Samsung GT-I9000 running ICS 4.0.4 while on my htc it works well.

Here is how I setup the recorder:

mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);
final String path = getRecordingAbsPath();
mRecorder.setOutputFile(path);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.prepare();
mRecorder.start();

Solution

  • This seems to be a hardware limitation as Michael noted.