Auto-Mute Audio During MacWhisper Dictation on macOS

If you use MacWhisper for voice-to-text dictation on your Mac, you’ve probably noticed the problem: when you hold down your dictation key, whatever audio is playing — Navidrome, Apple Music, YouTube, Spotify — bleeds into your microphone and garbles the transcription.

MacWhisper actually has a built-in “Mute Audio During Dictation” toggle in its settings. Unfortunately, if you’re running your audio through an external DAC or an audio routing app like SoundSourcefrom Rogue Amoeba, it doesn’t work. The standard macOS osascript volume commands return missing value for output volume when the system audio is being handled by an external device or third-party audio router, so the built-in mute has nothing to grab onto.

Here’s how I solved it using Karabiner-Elements and a pair of Apple Shortcuts.

What Didn’t Work

Keyboard Maestro was my first thought, since I already had it installed. But KM can’t trigger on modifier keys alone — Command, Option, Shift, etc. aren’t valid hotkey triggers in KM. And even if they were, MacWhisper intercepts the dictation key at a level below where KM operates, so KM never sees the keypress.

AppleScript volume commands like set volume output volume 0 and set volume output muted true do nothing when your output device doesn’t support system-level volume control. If you run osascript -e 'get volume settings' and see output volume:missing value, you’re in this boat. Common culprits include USB audio interfaces (like my Audient iD22), HDMI audio output, and apps like SoundSource that take over audio routing.

What Worked

The solution has three parts:

1. Create Two Apple Shortcuts

Open the Shortcuts app on your Mac and create two shortcuts:

“Mute Mac Audio” — This shortcut should mute your audio output. The exact action depends on your setup. If you’re using SoundSource, you can use its automation support. If you’re using standard system audio, the “Set Volume” action works. The key is finding whatever method actually silences audio on your particular setup.

“Unmute Mac Audio” — The reverse. Restore audio to its previous state.

Test both from the command line first to make sure they actually work:

bash shortcuts run 'Mute Mac Audio' shortcuts run 'Unmute Mac Audio'

If these don’t silence and restore your audio, the Karabiner rule won’t help — fix the shortcuts first.

2. Install Karabiner-Elements

Download Karabiner-Elements and install it. During setup, macOS will ask you to grant several permissions under System Settings → Privacy & Security, including Input Monitoring and a system extension. Grant them all.

Critical step that’s easy to miss: Open Karabiner-Elements Settings → Devices, and make sure your keyboard has “Modify events” toggled ON. If this is off, Karabiner will see your keypresses in EventViewer but won’t actually act on any rules. This one had me stuck for a while.

3. Add the Karabiner Complex Modification

In Karabiner-Elements Settings, go to Complex Modifications → Add your own rule, and paste this JSON:

json { "description": "Mute audio while Right Command held (for dictation)", "manipulators": [ { "type": "basic", "from": { "key_code": "right_command", "modifiers": { "optional": ["any"] } }, "to": [ { "shell_command": "shortcuts run 'Mute Mac Audio'" }, { "key_code": "right_command" } ], "to_after_key_up": [ { "shell_command": "shortcuts run 'Unmute Mac Audio'" } ] } ] }

Save it, and you’re done.

How It Works

When you press and hold Right Command (or whatever your dictation key is), Karabiner intercepts it, fires the mute shortcut, and then passes the key through to macOS so MacWhisper’s dictation still activates. When you release the key, Karabiner fires the unmute shortcut and your audio resumes.

A Couple of Gotchas

Order matters in the to array. You might think to pass through right_command first and then run the shell command. That’s what I tried initially, and dictation broke — MacWhisper wouldn’t activate. Running the shell command first and the key passthrough second is what made both the muting and the dictation work simultaneously.

The "modifiers": { "optional": ["any"] } bit is important. Without it, Karabiner may not match the key correctly when it’s a modifier key being used on its own.

Adapt the key code to your setup. If your dictation key is Right Option, use "right_option". If it’s the Globe/fn key, use "fn". You can check what Karabiner sees by opening the Karabiner-EventViewer app (installed alongside Karabiner-Elements) and pressing your key.

Preserve your volume level. If your shortcuts just slam volume to zero and back to a fixed level, you’ll lose your previous volume setting. Design your Mute shortcut to save the current volume state and your Unmute shortcut to restore it.

Tools Used

Posted

in

,

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

To respond on your own website, enter the URL of your response which should contain a link to this post’s permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post’s URL again. (Find out more about Webmentions.)

Current Spins

Top Albums

Check out my album Set It All Down on your favorite streaming service.


Posts Worth Reading:


Letterboxd


Reading Notes

  • Who profits from our constant state of dissatisfaction? The answer, of course, is painfully obvious. Every industry that sells a solution to a problem you […]
  • the shifts have been in place for awhile. A certain kind of book—say those reviewed in the NYRB—will become like opera, or theater, or ballet, […]
  • • No more struggle: “Whatever arises, train again and again in seeing it for what it is. The innermost essence of mind is without bias. […]
  • The real problem, in my mind, isn’t in the nature of this particular Venture-Capital operation. Because the whole raison-d’etre of Venture Capital is to make […]
  • . The EU invokes a mechanism called the precautionary principle in cases where an innovation, such as GMOs, has not yet been sufficiently researched for […]

Saved Links

RSS Error: A feed could not be found at `https://links.jimwillis.org/feed/atom?`; the status code is `404` and content-type is `text/html; charset=utf-8`