muteMic method

Future<void> muteMic()

Disables (mutes) the microphone device for the local participant.

  • When the microphone is successfully disabled, a Events.streamDisabled event is emitted with the corresponding audio Stream object in the event handler, inside the associated Participant object.

Events associated with muteMic()

Example

// Mute microphone
await room.muteMic();

room.on(Events.streamDisabled, (event) {
  print('Microphone stream disabled: ${event.stream.id}');
});

// Mute microphone from a button
ElevatedButton(
  onPressed: () async {
    await room.muteMic();
  },
  child: Text('Mute Mic'),
)

Implementation

Future<void> muteMic() => _disableMic();