← Back to marginalia

Tink: teaching a laptop to understand a hum

A sound-to-speech tool I started building at HackTX 26 for people who can make sounds but not words. The honest eval is the interesting part.

Contents · 8 sections
  1. 1.the short version
  2. 2.why is this hard?
  3. 3.how does it work?
  4. 4.the part I care about most
  5. 5.did it actually work?
  6. 6.what i learned
  7. 7.what's next
  8. 8.sources
Tink: teaching a laptop to understand a hum

Tinker Bell can't speak in words. She talks in chimes, and Peter still understands her.

That was the whole pitch for Tink, which I started building at HackTX 26 (UT Austin, October 24 to 25), where the theme was fairy tales. Tink learns the sounds one nonspeaking person can make, like a hum, two clicks, or a sigh, and says out loud what each one means. If they banked their voice earlier, it speaks in their own voice.

It's meant for people who can make sounds but not words: people with ALS or a stroke, minimally speaking autistic people, and ESL speakers who want to teach a sound with a phrase in their own language. A caregiver runs the screen.

It's also close to home. I research ALS speech in the Wang Lab, so this sits right next to my day job.

the short version#

  • What it does: learns a person's sounds from about five examples each, with no training run, and speaks what they mean.
  • The honest number: on 7,077 real sounds from 8 minimally speaking people, Tink got 27% against 19% chance. Above chance for 6 of 8 people, and far from reliable.
  • Why it's low: the limit is the data, not the five-example learning. A model trained on all of a person's other data only reached 30%.
  • What it hasn't done: Tink has not been tested with nonspeaking users yet.

why is this hard?#

Speech recognizers are built for words. Hums, clicks, and sighs are exactly the sounds they throw away. On top of that, every person's sounds are different, and the same person's sounds drift from day to day. So there's no big labeled dataset to train on, and the tool has to learn from a handful of examples from one person.

So the question I wanted to answer was whether five examples of a sound are enough to recognize it again.

how does it work?#

  1. Teach a sound. Record it about five times and type what it means. Each take also gets four augmented copies (a semitone up and down, plus two noise levels), so it still matches when the voice drifts.
  2. Embed it. I used voc2vec, a model pretrained on 125 hours of non-verbal sounds. There's no training run. Each sound is the average (centroid) of its takes, and new clips are matched with mean-centered cosine similarity.
  3. Self-calibrate. Each take is held out and matched against the others. That sets the confidence level and the "didn't catch it" threshold for this one person.
  4. Combine the evidence. A Bayesian posterior mixes the audio match, a time-of-day prior that learns every time someone presses "Right", and optional webcam cues (nod, shake, smile, frown, eyes closed). Only the cue words leave the browser, never video. There's an explicit "unknown" option, so it doesn't guess.
  5. Speak. It plays the person's banked recording if there is one, otherwise the browser voice.

Take for example how you'd learn a friend's handwriting. You don't need a thousand samples, a few notes are enough, since you compare each new letter to the ones you've seen. The same way, Tink compares each new sound to the few takes it has and picks the closest one.

the part I care about most#

Message banking is the center of it. While someone with ALS can still talk, they record the phrases they'll want later. When the day comes, Tink plays their real voice instead of a robot voice.

Two design choices came from thinking about what happens when it's wrong:

  • Yes/no dialogue. When two meanings are close, Tink asks, and the person answers with their own yes and no sounds.
  • Urgent sounds. Something like "I can't breathe" fires at lower confidence, turns the screen red, and repeats until someone presses "I'm here". A missed alarm costs more than a false one.

Everything runs on the laptop by default, so nothing about a person's voice leaves the room.

did it actually work?#

I tested on ReCANVo, which has 7,077 real sounds from 8 minimally speaking people, labeled by their caregivers. I used balanced accuracy with session-disjoint splits (50 splits per person), where the test sounds always come from a different recording session than the examples.

Tink got 27% against 19% chance. That's above chance for 6 of 8 people, and far from reliable. The full breakdown is in docs/accuracy.md.

Here is what I checked after that, in order:

  • Is it the five examples? No. A logistic regression trained on all of a person's other data only reached 30%. So the limit is the data.
  • Does voc2vec's advantage hold? Not clearly. It beat HuBERT and wav2vec2 by 3 to 7 points at the default layer. Once each model got its best layer, they all tied.
  • Do more examples help? Probably. Going from 5 to 20 examples moved accuracy from 27% to 42%, but those are different splits, so it's not a clean comparison.
  • Is the scoring leaking? No. A label-shuffle check dropped every person to chance.

Honest caveat. ReCANVo is full of spontaneous emotional sounds. Tink is built for deliberate signal sounds, like "two clicks means water", and no dataset of those exists. So this eval is a rough proxy, not a test of the real use case.

And to be clear, Tink has not been tested with nonspeaking users. The live site is a static landing page, and the real app needs the model, so it runs locally.

what i learned#

  • Demos vs evals: a demo that works on stage and an eval that works on real data are different things.
  • Baselines: checking a fully trained model first told me the data was the limit, not my method.
  • Layers: a model's advantage in its paper can disappear once every model gets its best layer.
  • Leakage checks: a label shuffle is a cheap way to prove your numbers aren't fake.

what's next#

The real next step is recording deliberate sounds from actual users and seeing whether five examples is enough when the sounds are chosen on purpose. Until then, I'd call this a promising prototype with an honest number attached.

The code is public at github.com/hammy229/tink, and there's a landing page if you want a look.

sources#

  • voc2vec: the model Tink is built on. It was trained on exactly the sounds speech models throw away.
  • ReCANVo: real sounds from minimally speaking people, labeled by the caregivers who know them, which is why it's the eval even though it isn't a perfect match.

Thus the 27% is less exciting than the demo, but it's the number that tells me what to build next. If you have any questions, feel free to reach out. Thanks for reading!