pulsemixer --id source-5 --toggle-mute
Seems easy, right? There's a catch!
source-5 identifier changes on boot. Check out your list of sources:
Pick your mic from the list, run the toggle command so it's in your command history, and then repeat as needed. You could even wrap it up in a shell script, or as I do, hook it up to your streamdeck or other external input. It would be even better if you could automate finding your source .... I have this dumped in a comment in the code but I haven't dared to use it for real yet:
pulsemixer --list-sources | cut -f3 | grep 'UMC404HD 192k Multichannel' | cut -d ',' -f 1 | cut -c 6-
I will leave it here just in case it's useful to you!
Pro-tip: More and more of the video conference tools seem to be introducing support for muting and unmuting you when your system microphone is muted or unmuted. This is brilliant because people can still see that you actively unmuted to say something!
Also published on Medium.