muteLocalAudio method
Mute/Unmute local audio
After local audio is muted, other members in the room will receive the onUserAudioAvailable(userId, false)
callback notification. After local audio is unmuted, other members in the room will receive the onUserAudioAvailable(userId, true)
callback notification.
Different from stopLocalAudio, muteLocalAudio doesn't stop sending audio/video data; instead, it continues to send mute packets with extremely low bitrate. Since some video file formats such as MP4 have a high requirement for audio continuity, an MP4 recording file cannot be played back smoothly if stopLocalAudio is used. Therefore, muteLocalAudio is recommended in scenarios where the requirement for recording quality is high, so as to record MP4 files with better compatibility.
Parameters:
mute
true
: muted; false
: unmuted
Implementation
Future<void> muteLocalAudio(bool mute // true:屏蔽;false:开启,默认值:false。
) {
return _cloudChannel!.invokeMethod('muteLocalAudio', {
"mute": mute,
});
}