BlogEngineeringKeeping an always-on microphone honest
EngineeringJuly 16, 20266 min read

Keeping an always-on microphone honest

A wake word means the microphone is always live. What that costs, what stops it firing at your podcast, and why detection never touches the network.

Hands-free mode means the microphone is open all the time. That is a meaningful thing to ask of someone, and it comes with two obligations: the audio must not leave the machine, and it must not cost so much CPU that the machine becomes unpleasant to use.

Detection is local, on every plan

Wake-word detection runs against a local model — roughly 42 MB, downloaded once behind an explicit consent prompt. Audio is never uploaded for wake-word detection. This is not a paid tier feature; the wake word itself is free, and only voice commands are gated.

The engine is vocabulary-restricted recognition rather than open-ended transcription, which is why the wake names are a curated list of ten rather than a free-text box. A name the recogniser reliably hears is worth more than a name you like the sound of.

Making it cheap

Running speech recognition continuously is the naive implementation and it is much too expensive. Several gates sit in front of it, each one cheaper than the next:

  1. 01
    An energy gate with an adaptive noise floor
    Silence costs almost nothing, and the floor adapts rather than assuming a fixed threshold.
  2. 02
    Voice activity detection
    Sound that is not speech does not reach the recogniser.
  3. 03
    A stationary-noise rejector
    Fans and air conditioning are steady, and steady is exactly what a fan is. They get filtered rather than repeatedly waking the recogniser.
  4. 04
    Only then, recognition
    By this point the audio is very likely to be someone speaking.

Not firing at your podcast

The failure mode users actually notice is the false trigger. A few things help:

  • Playback awareness. If audio is coming out of your own speakers, listening pauses. Your podcast saying a similar name does not wake it.
  • A second pass. After a match, the buffered audio is re-checked without the restricted vocabulary. A failed check shows "Didn't catch that" rather than opening dictation on a maybe.
  • Deliberate decoys. The recogniser's word list includes near-misses for the wake names. Sounds that are close to a wake name land on a decoy instead of being forced onto the real one.
  • An optional prefix. "Hey Annika" is meaningfully harder to trigger by accident than "Annika", and it is a single setting.
The sensitivity setting does one specific thing: at High and Very High the engine acts on partial results, so it responds sooner and misfires more. It does not slide a confidence threshold. If you are getting false triggers, dropping to Normal or adding a prefix are the two levers that work.

When the microphone quietly dies

An always-on audio stream fails in a way a short one does not: the operating system hands back a stream that reports itself perfectly healthy and delivers nothing but silence — literal zero-valued buffers — usually after a sleep, a wake, or a device change.

Nothing errors. From the app's point of view the room simply went quiet forever. There is a watchdog for exactly this: a stream producing exact zeros for twenty seconds is treated as dead, the device cache is rebuilt and the stream reopened, with a bounded number of attempts so a genuinely absent microphone does not become a retry loop.

It is not a glamorous feature. It is the difference between hands-free mode that works all day and hands-free mode you have to remember to restart.

Turning itself off

Listening stops when the machine sleeps or the screen locks, and you can add an idle timeout and a schedule. An always-on microphone should not be on at three in the morning just because you forgot.


Keep reading

More from the notebook.