Hiding the Hitch

This is how I dictate most of the time: MacBook closed on a stand, AirPods in, music on. Hold a key, talk, let go, and Cadabra types what I said.

With the lid closed, the Mac's own microphone records pure silence, so the AirPods are the only microphone there is. And with AirPods, three things kept going wrong. Cadabra didn't pick their microphone on its own. The music stayed loud while I talked. And the first word often went missing.

They looked like three bugs. They turned out to be one fact: AirPods are two devices. For music they're headphones, with high-quality stereo at 48 kHz. The moment anything opens their microphone, they become a headset, a call at 24 kHz with a different volume. Every press of the dictation key flips them from one to the other, and every release flips them back. Each of the three complaints lived somewhere in that flip.

None of this is a secret. Apple's own support page explains that Bluetooth headphones have one mode for listening and another for talking, and that sound stays worse until the microphone is released. The usual advice that follows is simple: don't use the AirPods microphone. With the lid closed, I don't have another one.

One moment to hang everything on

Before touching any of it, the key handling had to be put in order. It became a single state machine, idle, arming and recording, shared by the Mac and Windows versions and checked by one table of 25 key sequences that both test suites run. That was 1.5.4.

It sounds like housekeeping, but every fix below needed an exact moment to hang on. "The music is paused exactly while recording." "The mic closes again if the press turns out to be a shortcut." Without one place that knows what the key is doing, "exactly" isn't something you can promise.

Getting the microphone at all

Cadabra's Automatic microphone setting used to skip Bluetooth on purpose, because a headset microphone sounds worse. With the lid closed, that left nothing. So Automatic now follows whatever the system picks, AirPods included.

The first try froze the keyboard. Opening the AirPods microphone while they were playing music once took 8.4 seconds: that's how long the flip to call mode can take. The call that opens the mic doesn't return until it's done, and it was running on the same thread that listens to the keyboard. Now the mic opens in the background, and the recording bar says "opening the microphone" until the first sound arrives.

The volume nobody can touch

The music was the next problem. The obvious fix was to turn the volume down to 15% while I talk and put it back afterwards.

It didn't work, and the reason is the flip again. Cadabra turned the volume down on the headphones, and then the AirPods became a headset, which has a volume of its own. Setting that one just returns an error. To make it worse, one time the volume never came back up, and my music sat at 7% until I noticed.

So the music pauses instead, and that ran into a different wall: macOS no longer tells apps what's playing. The private interface Cadabra could have asked said nothing was playing while Music was playing. So Cadabra asks Music and Spotify themselves, only if they're open and playing, pauses them when the key goes down, and remembers their volume.

I'm not the only one who reached for this. Wispr Flow, a commercial dictation app, mutes the whole output when it hears something playing at the start of a dictation, with pausing as an experimental option. Pausing is the easy half, though. The hard half is the way back.

Listening to the switch

Pausing worked. Resuming didn't: the music never came back. Cadabra was waiting for the AirPods to go back into music mode, and it was watching for that by their device number, assuming the headset and the headphones had different ones. Sometimes they share one.

At that point there was no more guessing to do, so we measured. The first probe played silence through the AirPods and timestamped every time the system asked it for sound, so that a gap in those timestamps is a moment when nothing can be heard. It found one stall after each take, half a second or a bit more, and the reliable sign of the switch wasn't the device number but the sample rate: 24 kHz becomes 48 kHz again.

That was almost right. The second probe did exactly what Cadabra does: pause Music, open the AirPods microphone for anywhere from 1 to 8 seconds, then start Music again the instant the mic closes, and record every 5 ms whether the output is running. With real music playing, the stall turned out to be two.

Sixteen runs with Apple Music as the player, lined up at the key release. Each stays in call mode for 2.2 to 2.6 seconds, then the sound stops twice: a first stall of 335 to 823 milliseconds, about a tenth of a second of sound, and a second stall of 295 to 825 milliseconds. Sound is steady from 3.2 to 3.9 seconds. Cadabra starts raising the volume once the sound has run without a break for 0.4 seconds, which in every run is after both stalls. Above, the music volume for a typical run: paused while I talk, back at about 6 percent the moment I let go, and up to full over 1.5 seconds starting at about 3.9 seconds.

After the mic closes, the AirPods stay a headset for another 2.2 to 2.6 seconds. Then the sound stops for about half a second, comes back for about a tenth of a second, and stops again for another half second. After that it's steady, somewhere between 3.2 and 3.9 seconds after I let go. Every one of sixteen runs looks like this, whether the mic was open for 1 second or 8. That blip between the stalls is the hitch: the music isn't just interrupted, it stutters.

Plenty of people have complained about the switch into call mode. I couldn't find anyone who had timed the way back out.

There was a seventeenth run, which I had to throw out. In the middle of it I dictated a message, the AirPods became a headset again a tenth of a second after they'd stopped being one, and stayed that way. Two devices, and whoever opens the mic decides which one you get. It isn't only me: in a MacRumors thread this June, one reply traced someone's cutting-out AirPods to an app briefly asking for the microphone, after which they never switched back.

The stalls are the AirPods' own. No app can remove them. On an iPhone, iOS 26 gives apps a way to record from AirPods in high quality instead of as a phone call; in the Mac's SDK, that same option is marked unavailable.

Hiding the hitch

Since the hitch can't go, the question became how not to hear it. My idea was to resume right away, but quietly, and fade up, so the switch happens under music too soft to notice.

The first curve went from 15% to full over 4.5 seconds. It was better, but the hitch was still easy to hear, because by the time the stalls came, about 2.5 seconds in, the music was already back to about 70%. A fade only hides the hitch if it's still quiet when the hitch arrives.

So the music now comes back at about 6%, barely there, and waits. The question is what to wait for. The sample rate was the obvious signal, but the second probe showed it flips to 48 kHz at the start of the first stall: a fade keyed to it would rise straight into the stutter. What marks the end is sound that keeps going. Cadabra checks every 50 ms and starts the fade once the output has been in music mode and running without a break for a set time.

The blip decided how long. Replaying all seventeen runs against different waits:

  • 0.1 s of unbroken sound: in 13 of 17 runs the fade starts, and then a stall arrives.
  • 0.2 s: one run still fails, the one with the longest blip, 222 ms.
  • 0.3 s: none fail, but the margin over that blip is only 78 ms.
  • 0.4 s: none fail, with more than twice the margin, for 0.1 s more waiting.

So it's 0.4 s, and then up to the player's own volume over 1.5 s. Every stall now lands at 6%, and the music is fully back about 5 to 6 seconds after I let go. To my ears it sounds natural: the music just comes back.

The one that wasn't the AirPods

That left the missing first word, and I'd assumed it was Bluetooth too: surely the headset takes a moment to wake up. So does everyone else. Wispr Flow doesn't recommend AirPods for dictation because they can be slow to connect and may clip the first word, and its help page on missing first words suggests pausing briefly before speaking. The measurement said otherwise. The AirPods microphone delivers sound from its very first millisecond.

The lost time was Cadabra's own. From the key going down to the first recorded sample took about 0.3 seconds: 0.12 seconds of deliberate waiting, to tell a dictation from a keyboard shortcut that starts with the same key, plus about 0.17 seconds to open the mic. Start talking the moment you press, and your first word lands in that gap.

Now the mic opens the instant the key goes down, and the state machine gained one more step: if the press turns out to be a shortcut after all, the mic closes again and nothing is recorded. This is where the work from the start paid off. Adding that step was one new row in a table both apps already test.

What 1.5.6 does

With AirPods in, Automatic uses their microphone. The mic opens as soon as the key goes down, so the first word stays. Music and Spotify pause while I talk, come back quietly at once, and fade up once the sound has settled. That's a setting, and macOS asks once per player before Cadabra may control it. All of this is on the Mac only; the Windows version got just the new key rules, which both apps test with the same 25 key sequences.

The headset's own volume got the last word. Besides pausing the players, 1.5.5 still turned the device volume down while I talked, just in case. In call mode that lower volume carried over into music mode, and it couldn't be read back afterwards, so it was never restored. My AirPods got a little quieter with every dictation, from 50% down to 8% over the test builds and 1.5.5. 1.5.6 never touches a headset's volume in call mode. Pausing the players already covers it.

None of this makes AirPods into one device. Every time I let go of the key they still stop, stutter and stop again, about a second in all, while they turn back into headphones. I just don't hear it anymore.

Cadabra 1.5.6 is on GitHub, for the Mac and Windows.