The Agora RTC SDK enables you to manage the volume of the recorded audio or of the audio playback according to your actual scenario. For example, to mute a remote user in a one-to-one call, you can set the audio playback volume as 0.
Before adjusting the audio volume, ensure that you have implemented the basic real-time communication functions in your project. For details, see Start a Call or Start Interactive Live Streaming.
client.on("stream-subscribed", function(evt){
var stream = evt.stream;
// Sets the volume of the remote stream to 50.
stream.setAudioVolume(50);
});
client.on("stream-subscribed", function(evt){
var stream = evt.stream;
// Mutes the remote stream.
stream.setAudioVolume(0);
});
When adjusting the audio volume, you can also refer to the following articles: