Câu hỏi A pink shaded circle near the MacBook Pro is labeled "mystery beep · 2 hearings · within ~41 cm", and beside it a dashed plus marker suggests "add a listener here?
<p>Our house has a box room, full of boxes that we still haven't unpacked from our last move. A couple of weeks ago something in that room started <em>intermittently beeping</em>. The beeps were far enough apart that standing in the room and trying to determine the source of the noise was frustrating, and I really didn't want to dig through every one of those boxes. So I had Claude Code build <a href="https://github.com/simonw/beep-locator">Beep Locator</a>, a software system for triangulating the source of a mysterious beep using multiple devices scattered around the room.</p> <p>Here's what Beep Locator looks like after it has been running for a while:</p> <p><img src="https://static.simonwillison.net/static/2026/beep-locator-ui.webp" alt="Screenshot of a web app that uses several phones, tablets and laptops as microphones to locate a mystery beeping sound in a room. The left column has an "Add a listener" panel with a QR code and join link, a "Controls" panel with buttons including "Calibrate", "Test beep" and "It just beeped!" plus a "Listen for beeps" checkbox, and a "Mystery beep" note reading "3345 Hz · 3 confirmed · remembered across sessions". Below that, a "Devices" list shows five color-coded listeners (Simon iPhone, New iPad, Old iPad, MacBook Pro, Surface Ultra), each marked "✓ mic working · ✓ speaker working". The main area is a gridded map with a 1 m scale bar that shows the five devices as colored dots and earlier sounds as small timestamped markers. A pink shaded circle near the MacBook Pro is labeled "mystery beep · 2 hearings · within ~41 cm", and beside it a dashed plus marker suggests "add a listener here? could tighten the mystery beep's position by ~12%". Below the map, a "Mystery beep loudness warmer / colder" panel shows a bar for each device: Surface Ultra is loudest at "-6.0 dB ▲ +11.6 dB warmer", with the note "about 6 dB louder means roughly half the distance". At the bottom, a "Sounds located" table lists recent claps and beeps with coordinates, or the warning "arrival times are not physically possible (echo or a different sound?)"." style="max-width: 100%;" /></p> <p>You run Python web server to show the primary UI, and then use the QR code or URL to connect as many devices as you can spare to act as listeners - I was using two iPads, a phone, a MacBook Pro and a Surface Ultra.</p> <p>The devices then play noises to each other to help estimate their locations. This didn't work particularly well, so I added a "Rough mode" where you can drag their icons around in the space to provide rough locations which are then adjusted based on those sounds.</p> <p>Once that's set up, the devices all listen for the beep!</p> <p>I added a clapping mode too so I could test it by clapping my hands in different locations around the room - displayed as diamonds on the map. This helped me gain confidence that it was capable of locating a sound.</p> <p>Beeps show up on the map as an X, plus a line in the "Sounds located" log. You can replay these sounds (from each device in turn) to confirm they are the mysterious beep you are looking for, then click "This is the mystery beep" to mark them as such.</p> <p>Once you've confirmed the mysterious beep frequency the system will listen out for it, measure the interval between beeps, and use the triangulated locations to lock down the most likely location on the map.</p> <p>The system worked as intended. It gave me the position of the beep to within about 40cm, then I dug through that specific pile of boxes and found an ancient carbon monoxide detector that desperately wanted its batteries replaced.</p> <h4 id="how-it-works">How it works</h4> <p>When I started working through this problem with Claude it quickly dug up <a href="https://www.cs.purdue.edu/homes/chunyi/pubs/sensys106-beepbeep.pdf">BeepBeep: A High-Accuracy Acoustic-Based System for Ranging and Localization Using COTS Devices</a>, a 2007 paper by Chunyi Peng, Guobin Shen, Yongguang Zhang, Yanlin Li, and Kun Tan. Here's that paper's abstract:</p> <blockquote> <p>We present the design, implementation, and evaluation of BeepBeep, a high-accuracy acoustic-based ranging system. It operates in a spontaneous, ad-hoc, and device-to-device context without leveraging any pre-planned infrastructure. It is a pure software-based solution and uses only the most basic set of commodity hardware – a speaker, a microphone, and some form of device-to-device communication – so that it is readily applicable to many low-cost sensor platforms and to most commercial-off-the-shelf mobile devices like cell phones and PDAs. It achieves high accuracy through a combination of three techniques: two-way sensing, self-recording, and sample counting.</p> </blockquote> <p>That sounded exactly like what we needed to build!</p> <p>Beep Locator runs a Python web application server that does most of the work. The listening devices then connect to that server via WebSockets and present a UI which requests browser microphone access. The listeners mainly work by recording a 60 second buffer of recent audio. They also run a simple beep detection algorithm (see <a href="https://github.com/simonw/beep-locator/blob/main/beep_locator/modules/listener/detector.js">detector.js</a>), which uses Fast Fourier Transform and a high-pass filter to identify potential beeps. It sends these events to the main server.</p> <p>When a beep is reported, the server has a device play a short chirp (the device with the lowest round-trip time to the server), then asks every listener upload a clip from about 0.6s before the beep to 0.8s after that chirp. This chirp allows the clips to be aligned with each other, a crucial step in locating the beep.</p> <h4 id="how-i-built-it">How I built it</h4> <p>I started this project using Claude Code Cloud via my iPhone, with Opus 5.5
Nguyên văn nguồn Chi tiết nguồn