Mute Your Microphone with Keyboard Maestro
Sunday, February 4, 2018 at 10:22PM
Stephen Millard in AppleScript, Keyboard Maestro, Technology

Whilst I’m not a presenter on radio or podcast show, I do actually spend a fair amount of time speaking to people via my computers. I join conference calls, webinars and everything in between. For this I have my trusty Blue Yeti microphone. Not a top of the line microphone, but a notable improvement over the USB Jabra Speakerphone I used previously; though I still use this as my speaker and as my travel microphone.

When I switched to the Blue Yeti I found the mute button fiddly and not always responsive. In fact I really don’t like having to touch a button on the microphone at all whilst using it. It can add a rather unpleasant {thud} to the audio. To this end I began looking for alternatives. Today I’m going to share one of those that I’ve been using for years that uses Keyboard Maestro and a bit of AppleScript to take control of my microphone.

The basic premise of this approach was to be able to toggle the microphone input level (within the Mac OS sound settings) between it’s original setting and zero. Setting the input level to zero mutes the microphone for all intents and purposes.

The Keyboard Maestro macro works as follows.

First it checks to see if it has saved a volume level before. If not it defaults to 100. If your volume level were initially zero there would in effect be no alternative to switch to so I decided to have an initialisation for the first macro run of a volume level of 100.

The next step is to run a bit of AppleScript to save the current volume level to a Keyboard Maestro variable. It’s value is then checked to see if it is zero.

If it is zero then the macro will run some additional AppleScript to set the volume level to whatever the last recorded volume level was; or the initialised value of 100 set earlier. After setting this a notification of the level is displayed.

If the current cound level was non-zero, then the current volume level is captured to a Keyboard Maestro variable for use on toggling the volume level back next time. AppleScript is then used to set the volume level to zero and a notification is once again displayed.

By making this a single script tied to a single button (in this case F13 for my full size Apple keyboard) that toggles the muting on and off I effectively have a nice simple cough button that is not physically tied to the microphone.

The details of the macro are shown in the screen shot below. You can download the macro directly from here, but please do be security minded and check it through before you run it to ensure you are happy with what it will do on your system - just toggle your microphone volume level I hope.

Article originally appeared on Thought Asylum (http://www.thoughtasylum.com/).
See website for complete article licensing information.