I just realized I can get around one of the major limitations of MacOS by using Keyboard Maestro.

The problem

MacOS doesn’t have a built-in way to disable audio devices or prevent them from being used.

My problem was, my default audio devices (input/output) would sometimes get changed when I plugged my MacBook Pro into the USB dock on my desk. My HDMI monitor advertises as having a speaker, but doesn’t have a speaker, so I’d occasionally hear nothing when joining a Teams meeting, because MacOS for some reason wanted to use that device as the default output. The way that Mac chose input/output devices seemed random.

The solution

But! Keyboard Maestro (KM) can fix this.

I have a Stream Deck that’s plugged into my USB hub at home, and KM is able to take actions based on a USB device connecting. All I had to do was enter the name of the USB device into the trigger, and set the audio devices. Easy!!!

I used system_profiler SPUSBDataType to find the correct name of the device, which conveniently was named Stream Deck.

Add a trigger and two actions in KM, and I’m done! ✅

If you use a USB dock at home, give this a try. It’s saving me a bunch of time and annoyance.