Turn on/off the microphone

Hi, I am developing an video conferencing application for a social cause, using the Jitsi Meet API library. I need the ways to turn on/off the Microphone. Can anyone please provide me a snippet for that.

var toggleMicrophone = (isMuted) => {
    if (isMuted) {
        this.tracks.local.audio.mute();
    } else {
        this.tracks.local.audio.unmute();
    }
};
1 Like