caution
Mic Controls
Whenever any participant wants to start / stop broadcasting their audio to other participant in meeting, they can simply do it with VideoSDK Meeting.
This guide will provide an overview of how to use enable and disable Mic in a meeting.
- Enable Mic - By using
unmuteMic()
function, a participant can publish audio to other participants. - Disable Mic - By using
muteMic()
function, a participant can stop publishing audio to other participants. - Change Mic - By using
changeMic()
function, a participant can change mic.
Enable, Disable, Change Mic
note
For Javascript, we will use unmuteMic()
function for publish audio to other participants and muteMic()
function for stop publishing audio to other participants.
Enable, Disable Mic
- JavaScript
- React
- ReactNative
- Android
- IOS
- Flutter
const onPress = () => {
// Enable Mic in Meeting
meeting?.unmuteMic();
// Disable Mic in Meeting
meeting?.muteMic();
// Change Mic in Meeting
const mics = await meeting?.getMics(); // returns all mics
const { deviceId, label } = mics[0];
meeting?.changeMic(deviceId);
};
const onPress = () => {
// Enable Mic in Meeting
meeting?.unmuteMic();
// Disable Mic in Meeting
meeting?.muteMic();
// Change Mic in Meeting
const mics = await meeting?.getMics(); // returns all mics
const { deviceId, label } = mics[0];
meeting?.changeMic(deviceId);
};
const onPress = () => {
// Enable Mic in Meeting
meeting?.unmuteMic();
// Disable Mic in Meeting
meeting?.muteMic();
};
btnMic.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Toggle participant mic in meeting
if (micEnabled) {
meeting.muteMic();
} else {
meeting.unmuteMic();
}
}
});
@IBAction func micButtonTapped(_ sender: Any) {
if !micEnabled {
// enable/unmute mic
self.meeting?.unmuteMic()
} else {
// disable/mute mic
self.meeting?.muteMic()
}
}
ElevatedButton(
onPressed: meeting.unmuteMic,
child: Text("unmuteMic"),
),
ElevatedButton(
onPressed: meeting.muteMic,
child: Text("muteMic"),
),
Got a Question? Ask us on discord