muteLocalAudio method Null safety

Future<void> muteLocalAudio(
  1. bool mute
)

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(true) 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: muted; false: unmuted. Default value: false
    ) {
  return _channel.invokeMethod('muteLocalAudio', {
    "mute": mute,
  });
}