Finding a Hidden Beep with a Roomful of Browsers


A room full of unpacked boxes is a poor place to hunt for a sound that happens only occasionally. By the time a person hears the beep and turns toward it, the sound is over. Waiting in a different corner may give another guess, but it does not reliably identify the box. Simon Willison faced exactly that problem and turned the devices already at hand into an improvised acoustic instrument. The eventual culprit was an old carbon monoxide detector asking for replacement batteries.

His Beep Locator project used two iPads, a phone, a MacBook Pro, and a Surface laptop as listeners. Each opened a browser page served by a Python application. A QR code made joining the room’s experiment straightforward, while WebSockets carried detections and commands between the clients and server. The point was not to record the room indefinitely for a human to inspect. It was to convert a rare, hard-to-place event into several recordings of the same event, then compare them.

First, make the room observable

Each listener asked for microphone access and kept a rolling 60-second audio buffer. A lightweight detector looked for likely beeps using a high-pass filter and a fast Fourier transform. A candidate event went to the server. The browser’s Web Audio API provides the waveform and frequency data needed for this kind of local analysis; it does not, by itself, tell one device where another device’s clock or microphone is in the room.

That distinction matters. A tone near the expected frequency can trigger a candidate, but the room also contains unrelated noises. The application therefore let Willison replay the short recordings from each listener, mark a confirmed event as the mystery beep, and then use its frequency and spacing to recognize later occurrences. A clap mode provided a deliberately generated sound at a known place. Claps appeared differently on the map, so he could test the system before trusting a mystery-beep estimate.

Dark-mode flow diagram of distributed beep detection and analysis

A shared chirp supplies a timing reference

Multiple microphones offer location information because sound reaches them at slightly different times. If a source is closer to one listener, the wavefront arrives there first. Given known listener positions and sufficiently well aligned recordings, those arrival differences constrain the possible source position. This is the principle behind time-difference-of-arrival localization.

Ordinary phones and laptops are awkward members of a microphone array. Their browser clocks are independent, network messages have variable delay, and their positions were not measured with survey equipment. The project addressed the timing problem with a second sound. When a beep was reported, the server chose the listener with the lowest round-trip time and told it to emit a short chirp. Every listener then uploaded a clip covering roughly 0.6 seconds before the beep through 0.8 seconds after the chirp. The common chirp in those clips gave the server a feature with which to align the recordings. It could then compare where the earlier mystery beep fell in each aligned clip.

The calibration idea was informed by BeepBeep, a research system that used commodity speakers and microphones for acoustic ranging. Beep Locator was a home-built adaptation, not a claim that browsers provide precise synchronized sensors. Its interface even warned when inferred arrival times were physically impossible, a useful clue that an echo or another sound had confused the estimate.

Dark-mode diagram showing a shared chirp aligning independent audio clips

Positioning the listeners was its own experiment

Knowing when a sound arrived does little good without knowing where each listener sat. The application first had devices play sounds to one another to estimate relative positions. That automatic calibration was unreliable enough that Willison added a rough mode: drag each device’s icon to its approximate place in the room, then let the sound measurements refine the geometry. The map could also suggest a useful location for an extra listener. Moving one device toward the region of uncertainty could sharpen the next estimate without rebuilding the setup.

This practical combination is more interesting than a perfect textbook triangulation. A person supplies approximate spatial knowledge; the software contributes repeatable timing measurements. A known clap checks whether the combined estimate points to the place where the person actually clapped. A confirmed beep lets the system accumulate evidence across separate hearings. The result is a narrowing search region, not a magic pixel-perfect coordinate.

In the reported run, the system reduced the search to about 40 centimeters. That was enough to target one pile of boxes and find the alarm. The old detector’s battery warning was the mundane answer, but the route to it shows why several imperfect sensors can be more useful than one good ear: each rare beep becomes a set of comparable observations.

The coding agent was part of the instrument

Willison started with a description of the problem in an empty repository, then had Claude Code build the first version of the Python server and browser listeners. He continued developing it while the devices were deployed. The listener code included an installModule() path for replacing JavaScript modules over the WebSocket connection. This was convenient because some devices ask for microphone permission again after a page reload; swapping a module avoided walking around the room to reapprove every listener during each iteration.

He asked for rough positioning, clap tests, timestamps, replay controls, mystery-beep confirmation, and a repositioning workflow as the live experiment exposed needs. The agent could inspect the running application’s measurements and change the software that gathered them. In that sense, giving the coding agent “ears” meant providing a controlled path from physical microphones to data and back to a modifiable program. The agent did not hear like a person; it operated a measurement system that exposed the room through audio features and logs.

That is the broader engineering lesson. A browser microphone, a speaker, a server, and a map are ordinary parts. Their useful combination came from handling the awkward boundaries: independent clocks, microphone permissions, uncertain device positions, false detections, and echoes. The project succeeded because it made those uncertainties visible and gave the operator ways to test and correct them.

Sources

100%