During voice / video conversations I would like to mute/unmute the microphone without having to go through all these steps each time:
- Sound indicator, Sound preferences, Select Input, Mute or unmute the microphone.
I'm looking for either:
- an application that can do this from the command line,
- a way I can assign a keyboard shortcut that can mute/unmute the microphone
Go to System Preferences then Keyboard and click Shortcuts then Custom Shortcuts:
Click on Add
Fill in:
and
For USB webcams you need to chose the device (
-c 1
), or maybe another number.Click Apply and then associate a new key with this command (e.g. the Pause/Break key).
You can mute the microphone with
and unmute the microphone with
I switch between a USB webcam/mic and my internal mic and the other solutions typically work on the "default" device which is often not the device I'm actively using so I wrote this to mute all microphones
Simply mute/unmute with this command:
You can also add notification to make sure it's on or off, as per vladimirich answer to the same question
Inspired by Mark Rooney's answer on muting/unmuting sound.
pacmd
is the command line interface to PulseAudio (the sound subsystem used in recent releases). I don't know what the exact command is you'd need but I think you'd want to play with theset-sink-input-mute
function.pacmd
is interactive when run without instructions so you have a good opportunity to play around with it and convert that into a one-line function for toggling mute.the gnome-shell extension nothing to say, which can be installed from its extensions.gnome.org page, provides a microphone icon, mouse and keyboard control, and walkie-talkie style push-to-talk.
On 20.04, I see option to set a shortcut for the same under
Settings -> Keyboard Shortcuts -> Sound and Media
.There is no default key assigned though.
To toggle mute of default microphone in pulseaudio:
pacmd
(frompulseaudio-utils
package) andnotify-send
(fromlibnotify-bin
).You can mute with:
Unmute:
You just need to replace 'Master' with the appropriate mixer name, on the terminal use "amixer" to get a list of mixer devices.
About setting the keyboard shortcut check the answers for How can I find which command is bound to a given keyboard shortcut?