Skip to content
Frank Spin

Lab Free Mac tool

talkduck

Your music stays calm when you talk to your Mac

Talk to ChatGPT, Claude or Siri with AirPods in, and your music jumps. Dull, quieter, louder, and back again the moment you stop. talkduck is a small duck that fixes that.

Install How it started

The problem

Bluetooth headphones have two modes. As soon as your Mac uses your AirPods as a microphone, they switch to call mode. It sounds like a phone call from 2005. Stop talking and they jump back. That back-and-forth is what you hear.

Music mode A2DP

  • Stereo
  • 48 kHz
  • Listening only

Call mode HFP

  • Mono
  • 16 to 24 kHz
  • Listening and talking

What talkduck does

01

Picks another microphone

When Bluetooth headphones become the microphone, talkduck switches straight to your display’s, a USB mic or the built-in one. Your AirPods stay in music mode.

02

Turns your music down

While you talk, the volume drops a little. With a gentle fade, not a cut. When you’re done, it comes back slowly.

How it works

  1. 1

    You start talking

    An app turns on the microphone. talkduck notices within a quarter of a second.

  2. 2

    Is anything playing?

    The volume only drops if sound is actually coming out of your Mac. Silence stays silence.

  3. 3

    Gently down

    The volume drops 45% in 0.6 seconds, on a soft curve. No hard cut.

  4. 4

    You stop

    The microphone turns off. talkduck waits a second and a half, in case you have more to say.

  5. 5

    Gently back

    Back to your old volume in 1.2 seconds. Unless you touched the volume yourself: then yours stays.

Install

Paste this into Terminal. The script downloads the source, builds talkduck on your own Mac and starts it at every login. Takes half a minute.

curl -fsSL https://frankspin.com/downloads/talkduck/install.sh | zsh

Rather read what you run first? Fair. You can do this instead:

curl -fsSL https://frankspin.com/downloads/talkduck/install.sh -o ~/talkduck-install.sh
less ~/talkduck-install.sh   # read it first
zsh ~/talkduck-install.sh

No command line tools? The script asks you to run xcode-select --install first.

Check that it works

Put some music on, open the log and talk to your assistant. You’ll see something like this:

tail -f ~/Library/Logs/talkduck.log
talkduck started: mic switch on, fade 45% down in 0.6s, up in 1.2s
microphone: AirPods Pro → Studio Display Microphone
mic in use
fade down 69 → 38
mic free
fade up 38 → 69

Tune it

Too much? Too little? All values live in ~/Library/LaunchAgents/com.frankspin.talkduck.plist. Want it subtler? Set for example:

<key>DUCK_PCT</key><string>30</string>
<key>DUCK_FADE_SEC</key><string>1.0</string>

Then reload talkduck:

launchctl bootout gui/$(id -u)/com.frankspin.talkduck
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.frankspin.talkduck.plist
SettingDefaultWhat it does
DUCK_PCT 45 How many percent quieter the sound gets while you talk.
DUCK_FADE_SEC 0.6 How long the fade down takes, in seconds.
FADE_SEC 1.2 How long the fade back up takes.
RELEASE_SEC 1.5 How long talkduck waits after your last word, so the sound doesn’t bounce up and down at every short pause.
PREFERRED_MIC empty Part of the name of the microphone talkduck should switch to. Empty: a USB or display mic first, otherwise the built-in one.
MIC_GUARD 1 Set to 0 if you only want the fade and do want to use your headphones as a microphone.
DUCK 1 Set to 0 if you only want the microphone switch.

Questions

Does talkduck listen in?

No. talkduck only asks macOS whether a microphone is on and whether sound is playing, just like the orange dot in your menu bar. It hears nothing itself, records nothing and never connects to the internet.

Does it drain my battery?

Hardly. Asking macOS something four times a second is nothing; Activity Monitor shows talkduck at 0.0% CPU and about 40 MB of memory.

Why build it instead of downloading an app?

An app from the internet has to be signed by Apple, or your Mac blocks it. Building the source on your own Mac means you can read what it does first, and nothing runs that you can’t see. It’s about 150 lines.

The volume doesn’t go down

Check the log for "mic in use" when you talk. If it’s not there, you’re probably talking to another device, like your iPhone. If your volume is at 0, talkduck does nothing either.

My AirPods jump to my iPhone

That’s automatic switching. On your iPhone, go to Settings › Bluetooth › AirPods › Connect to This iPhone and pick "When Last Connected to This iPhone".

I want to make calls with my AirPods

Set MIC_GUARD to 0, or stop talkduck for a while with launchctl bootout. Otherwise talkduck keeps taking the microphone over.

Does it work with Spotify, YouTube, Apple Music?

Yes, with everything. talkduck controls the system volume, the same one as the volume keys on your keyboard.

Which Mac do I need?

A Mac with macOS 13 or newer, Apple silicon or Intel, and the Xcode command line tools.

Remove it

One line, and it’s all gone:

curl -fsSL https://frankspin.com/downloads/talkduck/uninstall.sh | zsh

The files: talkduck.swift (source code), install.sh, uninstall.sh.