linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-users] Do not turning on speakerphone when call is started


From: Никита Борисенков
Subject: [Linphone-users] Do not turning on speakerphone when call is started
Date: Mon, 24 May 2021 17:30:57 +0300

Hello. I have a problem with audio playback. I want the sound to be played through the handset and not through the speakerphone.
I have a video terminal with a handset. I make an outgoing video call, and when the call state switches to "Early media" the sound switches to the speaker

2021-05-24 15: 29: 05.778 6266-6266/org.linphone.debug I/Linphone: [Audio Manager] Turning on speakerphone

I have an API for my device that can switch the sound to handset, but the sound switches later, after the event (onCallStateChanged) occurs.

I've tried specifying "route_audio_to_speaker_when_video_enabled = 0" in the config

I also tried commenting out the code in the linphone-sdk that switches the audio output to the speaker:

cd mediastreamer2
$ git diff java/src/org/linphone/mediastream/MediastreamerAndroidContext.java
diff --git a/java/src/org/linphone/mediastream/MediastreamerAndroidContext.java b/java/src/org/linphone/mediastream/MediastreamerAndroidContext.java
index ff349cf9..a04ecae0 100644
--- a/java/src/org/linphone/mediastream/MediastreamerAndroidContext.java
+++ b/java/src/org/linphone/mediastream/MediastreamerAndroidContext.java
@@ -174,8 +174,8 @@ public class MediastreamerAndroidContext {
                        stopBluetooth();
                }
 
-               Log.i("[Audio Manager] Turning on speakerphone");
-               audioManager.setSpeakerphoneOn(true);
+               Log.i("[Audio Manager] Do NOT turning on speakerphone");
+               audioManager.setSpeakerphoneOn(false);
        }
 
        public synchronized static void enableEarpiece() {

This method works.

Is it possible to make the sound always go to the handset and not switch to the speaker without changing the code in linphone-sdk?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]