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
- MacWhisper — Local voice-to-text transcription for macOS using OpenAI’s Whisper
- Karabiner-Elements — Free, open-source keyboard customizer for macOS (GitHub)
- Apple Shortcuts — Built-in macOS automation
- SoundSource — Per-app audio control for macOS (Rogue Amoeba)
- Keyboard Maestro — Powerful Mac automation tool (but not the right tool for this particular job)

Leave a Reply