Simon Willison built Beep Locator, a Python web application using WebSockets and WebAudio to triangulate a mysterious beep in a box room using multiple devices as acoustic listeners. The system implements techniques from the 2007 BeepBeep paper by Peng et al., employing two-way sensing, self-recording, and sample counting for high-accuracy ranging on commodity hardware. Listeners (two iPads, a phone, MacBook Pro, and Surface Ultra) maintain a 60-second audio buffer and run a beep detector using FFT and a high-pass filter. Upon detecting a candidate beep, the server triggers the lowest-latency device to emit a synchronization chirp, then collects audio clips spanning 0.6 seconds before to 0.8 seconds after the chirp from all listeners for alignment. Initial automatic acoustic localization proved unreliable, so Willison added a "Rough mode" for manual drag-and-drop device positioning, refined by subsequent acoustic measurements. A clapping test mode validated localization accuracy, displaying claps as diamonds and beeps as X marks with HH:MM:SS timestamps. Users can replay recorded snippets per device to confirm the target beep, then mark it to enable frequency-specific tracking and interval measurement. The system located the beep within ~40 cm, revealing an old carbon monoxide detector needing battery replacement. Developed iteratively with Claude Code (Opus 5.5, then Fable 5.2), the architecture supports hot-swapping JavaScript modules to listeners via WebSockets, avoiding microphone permission re-prompts. Features added via natural-language prompts included repositioning workflows and optimal listener placement suggestions.
Read original
simonwillison