Talk to Text
Can you say a tongue twister fast without tripping? My friend Whisper is a real speech model. It listens and writes down every word it hears. Then we check how close you got!
Hold the button (or Space) while you talk, or tap once to start and again to stop. Max 8 seconds.
How did you do?
Whisper wrote
Word by word
What's happening inside
The microphone only turns on while you hold the button, and turns off right after. Nothing is uploaded.
How it works
Wiggles to numbers
Your voice is air wiggling. The microphone measures the wiggle 16,000 times every second.
A sound picture
Those numbers become a picture: low sounds at the bottom, high sounds at the top, time going left to right.
Listen
The listener half of Whisper studies the whole picture and makes a summary of what sounds are where.
Write
The writer half reads the summary and writes the words one little piece at a time, like a chatbot.
What just happened?
- Whisper never heard your voice before, but it learned from 680,000 hours of people talking, so it can understand lots of voices.
- It doesn't spell sounds out letter by letter. It guesses the most likely words. That's why tongue twisters are hard: “sea shells” and “she sells” sound almost the same!
- When it isn't sure, it picks a word that makes sense, even if you said a made-up one. Speech models guess, they don't really know.
- We scored you by lining up its words with the twister and counting the mismatches. Grown-up speech scientists use the same trick, called word error rate.
For grown-ups: what's really going on
Model: Xenova/whisper-tiny.en (OpenAI Whisper tiny, English-only, ~39 M parameters), run with Transformers.js 3.8 on WebAssembly via its automatic-speech-recognition pipeline. We load the encoder in full precision (fp32, ~33 MB) and the merged decoder 8-bit quantised (q8, ~31 MB), plus ~3 MB of tokenizer files: about 70 MB, cached by the browser after the first visit. 8-bit encoders noticeably hurt accuracy on the tiny model, the decoder tolerates it well.
- Architecture: an encoder–decoder transformer. Audio is padded to 30 s, turned into an 80-bin log-Mel spectrogram (25 ms windows, 10 ms hop → 3000 frames), two 1-D convolutions halve it to 1500 frames, and 4 encoder layers (d = 384, 6 heads) process it. A 4-layer decoder attends to it with cross-attention and generates byte-pair tokens autoregressively (greedy decoding here).
- Pre-processing in this page: we record with
MediaRecorder, decode withdecodeAudioData, average channels to mono, and resample to 16 kHz with a windowed-sinc (Blackman, 8 zero-crossings) low-pass so energy above 8 kHz does not alias. Quiet edges are trimmed because Whisper is known to hallucinate plausible text in long silences. Recording is capped at 8 s, uploads at 30 s (one Whisper window). - Word timings: we ask for
return_timestamps: "word", which aligns tokens to audio frames with dynamic time warping over selected cross-attention heads (the model'salignment_heads). If that fails we fall back to segment timestamps and spread each segment over its words by length. - Scoring: both texts are lower-cased, punctuation removed, small numbers spelled out, and split compounds joined ("sea shells" = "seashells"). Then a word-level Levenshtein alignment gives substitutions S, deletions D, insertions I, and
WER = (S + D + I) / Nwith N reference words. Accuracy = max(0, 1 − WER). Whisper tiny.en reports ~5.6% WER on LibriSpeech test-clean; fast children's speech and tongue twisters are much harder. - Language-model bias: the decoder is effectively a language model, so it "corrects" unusual phrases toward likely ones. That's great for normal speech and bad for tongue twisters and nonsense words, which is exactly what the challenges let kids discover.
- Latency: a few seconds of audio typically transcribes in about 0.5–3 s on a laptop CPU (the 30 s padding means the encoder cost is roughly fixed). The page shows the measured time.
- Privacy: the microphone opens only while the button is held/toggled, its tracks are stopped right after, and the audio stays in page memory. Nothing is sent to a server; only model files are downloaded from the Hugging Face hub.
Further reading: Radford et al., “Robust Speech Recognition via Large-Scale Weak Supervision” (2022) · openai/whisper-tiny.en model card.