ANDROID - Is there a way to mute the remote audio track without disabling it?

1,827 views
Skip to first unread message

Lucas Lafarga

unread,
Feb 18, 2016, 9:27:39 AM2/18/16
to discuss-webrtc

On Android, when a peerConnection is connected and onAddStream is called with the remote stream we can decide what to do with the remote video track, i.e we can add a renderer if we want to show it. But for the audio track there’s no option, it’s always played. Is there a way of muting the track without disabling it?


This issue is important for us because we are trying to relay streams in Android.

          

( A ) ------- Audio_A ------------>>( B ) --------Audio_A----------->>( C )


In this setup we want to send the Audio from A all the way to C and play it there. 

We use B to relay it and we don't want to play the audio in B.

If we disable the AudioTrack from the stream in B, it won't be relayed to C.


We took a look at the source code and it seems like WebRtcAudioTrack.java is getting the data from the native WebRTC layer and creating an Android AudioTrack and playing it, but we see no public method access. Would accessing this AudioTrack and using the normal API be enough to stop playback on B but keep WebRTC processing in place?


___________________________________________________

Tellybean. Making lifelike video calling available to everyone.

Christoffer Jansson

unread,
Feb 19, 2016, 3:56:33 AM2/19/16
to discuss-webrtc
AFAIK this is not easily done. Spoke to a colleague and he said that perhaps (no guarantees) it is possible to lower the volume digitally by calling https://code.google.com/p/chromium/codesearch#chromium/src/third_party/webrtc/voice_engine/voe_volume_control_impl.cc&sq=package:chromium&l=305&rcl=1455856238. However this is in the lower layers of WebRTC.

This is not a common use case, usually when muting audio, it is done as you described by disabling the incoming audio track or muting the microphone on the send side.

/Chris

--

---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/747e4de8-81d0-4a41-823d-78609035e951%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
/Chris

Lucas Lafarga

unread,
Mar 16, 2016, 8:32:36 AM3/16/16
to discuss-webrtc
Hi Christoffer,

Your answer was correct. Changing the volume for the different channels is the only solution that works, it allows us to mute one of the channels while the other one still has volume.

Thank you very much.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages