Android WebRTC can not mute remote sound on speaker

1,358 views
Skip to first unread message

quockh...@vnnplus.vn

unread,
Mar 1, 2017, 3:41:59 AM3/1/17
to discuss-webrtc
Hi,

Are there any ways to mute the remote sound on speaker ?
If I use volume button I can only lower the volume but can not mute the volume.

I use these code to bring sound to speaker :

AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
rollBackMode = audioManager.getMode();
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
rollBackSpeakOnPhone = audioManager.isSpeakerphoneOn();
audioManager.setSpeakerphoneOn(true);
rollBackVolumeControl = getVolumeControlStream();
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);

Henrik Andreasson

unread,
Mar 1, 2017, 5:40:55 AM3/1/17
to discuss-webrtc
You can't mute the speaker totally on Android in Comm mode. The idea is that a phone call
should never go totally silent. Hence, the behavior is expected and by design. 

You can however use this private API to mute the speaker completely if required.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/85f5cf66-7907-416a-b6dd-8176b97585f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dao Quoc Khanh

unread,
Mar 3, 2017, 7:32:04 PM3/3/17
to discuss...@googlegroups.com
Hi,

So are there any ways to change the remote sound volumes programmatically using java api?

You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/o_twMw_HFn4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAD2mqc4e3gj-gwmqEEM32jSskYjAgDhJBTGk8xALw0Ztga%2BAMw%40mail.gmail.com.

Henrik Andreasson

unread,
Mar 4, 2017, 8:30:40 AM3/4/17
to discuss-webrtc
The API shown earlier is a Java API and I think it will do what you asked for.
Or am I missing something?

quockh...@vnnplus.vn

unread,
Mar 4, 2017, 9:10:02 AM3/4/17
to discuss-webrtc
Hi,
I mean i want to override the onKeyDown function to handling the volume up/down button to change volume of the remote stream.

Can I do it with the webrtc android api ?
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/o_twMw_HFn4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Henrik Andreasson

unread,
Mar 4, 2017, 9:17:04 AM3/4/17
to discuss-webrtc
No, that is not supported and something that you have to deal with in your app that uses WebRTC instead.

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/1a9771a6-3f17-4ac0-8a56-4b8e2a680807%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages