muteMicrophone method

Future<void> muteMicrophone(
  1. bool mute
)

Mutes or unmutes the microphone.

Available since: 1.1.0 Description: This function is used to control whether to use the collected audio data. Mute (turn off the microphone) will use the muted data to replace the audio data collected by the device for streaming. At this time, the microphone device will still be occupied. Use case: Users can call this interface by only turning off the human voice collected by the microphone and not turning off the music sound of the media player. This interface affects onBeforeAudioPrepAudioData. Default value: The default is false, which means no muting. When to call: After creating the engine createEngine. Restrictions: None. Related APIs: Developers who want to control whether to use microphone on the UI should use this function to avoid unnecessary performance overhead by using the enableAudioCaptureDevice. You can use isMicrophoneMuted to check if the microphone is muted.

  • mute Whether to mute (disable) the microphone, true: mute (disable) microphone, false: enable microphone.

Implementation

Future<void> muteMicrophone(bool mute) async {
  return await ZegoExpressImpl.instance.muteMicrophone(mute);
}