Search code examples
agora.ioagora-web-sdk-ng

Can we mute remote audio at source while using Agora Web SDK API?


I am working on an application where host needs to mute other participants. I have tried using remotestream.muteAudio() api. But this doesn't mute the audio at source. Which means with this API, if host mutes Participant A it is muted only for the host. But participant B can still hear Participant A.

I went through the API documentation and couldn't find the solution. https://docs.agora.io/en/faq/API%20Reference/web/interfaces/agorartc.stream.html#muteaudio

Can this be achieved by any ways?


Solution

  • Hi there you need to use the Agora RTM SDK to do that.

    You can create an RTM channel with the same name as the RTC channel. Alternatively, You can use P2P messaging(Also present in RTM) if that suits your use case better.

    Then the host can send a message to the concerned user to mute. On receiving this message, the user can call the muteAudio on their side, thereby muting the audio at source. All of this would be done programmatically.