Toggle on/off Microphone Ubuntu

Refer: https://www.mankier.com/1/pactl#Commands-set-sink-input-mute

To Mute Microphone

pactl set-source-mute @DEFAULT_SOURCE@ true;alert "microphone muted"

To Unmute Microphone

pactl set-source-mute @DEFAULT_SOURCE@ false;alert "microphone live"

Refer: https://askubuntu.com/questions/26068/how-do-you-mute-from-the-command-line

To mute Speakers

pactl set-sink-mute @DEFAULT_SINK@ true

To unmute Speakers

pactl set-sink-mute @DEFAULT_SINK@ false

Refer: https://www.linuxquestions.org/questions/linux-desktop-74/how-do-i-toggle-the-microphone-with-a-command-or-with-autokey-4175654480/

To Toggle, you need to find the right value for N, just start at 1 and increment

pactl set-source-mute N toggle
pactl set-source-mute 2 toggle

Leave a Reply