Real-time DTMF decoder and visualizer. Feed it an audio file or live mic input. It decodes dual-tone multi-frequency signals via FFT and visualizes each keypress as it happens.
Every telephone keypress is encoded as two simultaneous sine waves, one from a row frequency (697–941 Hz) and one from a column frequency (1209–1633 Hz). This tool:
- Captures audio from a file upload, mic, or bundled sample
- Runs a real-time FFT at 4096 points (~10 Hz/bin resolution)
- Detects which row + column frequency pair is active above threshold
- Flashes the matching key on a visual phone keypad
- Streams decoded digits to a rolling ticker
- Vanilla TypeScript — no framework, direct DOM + Canvas API
- Web Audio API —
AnalyserNodewithgetFloatFrequencyData - Vite — dev server and build
- Bun — runtime, package manager, test runner
- Cloudflare Pages — deploy target
bun install
bun run devbun run build # outputs to dist/FFT frame (4096 points)
→ scan 4 row freqs (697, 770, 852, 941 Hz)
→ scan 4 col freqs (1209, 1336, 1477, 1633 Hz)
→ if one row + one col both exceed -40 dB threshold
→ stable for ≥ 40ms → emit DetectionEvent
→ cooldown 120ms to prevent repeat firing
FFT size of 4096 at 44100 Hz gives ~10.8 Hz per bin — sufficient to distinguish 1336 Hz from 1477 Hz (141 Hz apart) with no ambiguity.
MIT