deweller / switchaudio-osx

Change the audio source for Mac OS X from the command line.
Other
1.19k stars 88 forks source link

Add flag for setting the `mute` flag on an audio device #49

Closed peanball closed 1 year ago

peanball commented 1 year ago

The mute flag can be set on input and output devices via CoreAudio. For input devices this is not exposed in the UI, besides via the Audio MIDI Setup utility.

The benefit over just reducing the volume to 0, which also turns on the mute flag is that just toggling the flag keeps the volume level defined before, when unmuting.

This PR introduces a new flag (-m) that allows muting, unmuting or toggling based on the current mute state.

I've mapped this to a hotkey that allows me to reliably mute, e.g. during Teams calls.