Record only caller's voice in android
Asked Answered
P

2

8

I am using MediaRecorder for recording call in android. But I only want to record the caller's voice. Can this be done?

    recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    // mRecorder.setOutputFile("/sdcard/yousuck2.3gp");
    if (audiofile == null) {
        File sampleDir = Environment.getExternalStorageDirectory();

        try {
            audiofile = File.createTempFile("ibm", ".3gp", sampleDir);
        } catch (IOException e) {
            Log.e(TAG, "sdcard access error");
            return;
        }
    }

Also what is the difference between VOICE_CALL, VOICE_UPLINK and VOICE_DOWNLINK? I read the Android docs but could not understand.

Puiia answered 14/5, 2013 at 5:52 Comment(1)
Hello in my case i want both side recording but in some mobile like Samsung S8plusEdhe, S7edge is not working they only record my voice not other side voice whom i talking on phone.Momentarily
M
3

Before time ago I had the same problem I searching a lot than I found the simple word solution from https://mcmap.net/q/1049421/-android-audiorecord-which-settings-to-record-call I came to know that VOICE_UPLINK: The audio transmitted from your end to the other party. IOW, what you speak into the microphone (plus surrounding noise depending on whether noise suppression is used and how well it performs).

VOICE_DOWNLINK: The audio transmitted from the other party to your end.

VOICE_CALL: VOICE_UPLINK + VOICE_DOWNLINK.

so I use the record format as DOWNLINK and its work fine hope this is the simple word to distinguish.

Marvelofperu answered 2/11, 2015 at 6:28 Comment(1)
I have checked it on LG nexus5Marvelofperu
J
0

Also what is the difference between VOICE_CALL, VOICE_UPLINK and VOICE_DOWNLINK??? i read on Android docs... did not understand.

Classes MediaRecorder.MediaSource now after API Level 4 ( Android 1.6 ) Includes

  1. VOICE_CALL Voice call uplink + downlink audio source
  2. VOICE_DOWNLINK Voice call downlink (Rx) audio source
  3. VOICE_UPLINK Voice call uplink (Tx) audio source

See the Details here

proff link

I am using media recorder for recording call in android. But I only want to record the caller's voice.. Can this be done?

As a short answer, it is impossible to record call directly in android platform so far, due to hardware architecture. Most of the call recorders in market record voice when device on speaker or same technics.

Jerilynjeritah answered 14/5, 2013 at 7:14 Comment(2)
I saw that link. I ran codes for all the cases.. but they all are working the same.. so i am not understanding the purpose of the three sources. Plz ExplainPuiia
"Also what is the difference between VOICE_CALL, VOICE_UPLINK and VOICE_DOWNLINK??? i read on Android docs... did not understand." #10330840Gastrocnemius

© 2022 - 2024 — McMap. All rights reserved.