muteMic method
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()
- Events.streamDisabled with the disabled audio Stream
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();