---
title: "用多台设备和Claude Code定位房间里的蜂鸣声"
canonical: "https://siyuanailab.com/curation/translations/e9a4a31f2d395c69845166da323797b7-b18d040af718f8e94a7f4666382795da0e3ea7db99331e888ecac6b0ea56a0ef/"
dateModified: "2026-11-11"
datePublished: "2026-11-11"
---

[返回日报条目](https://siyuanailab.com/curation/#entry/e9a4a31f2d395c69845166da323797b7)

 

资料节译

 

# 用多台设备和Claude Code定位房间里的蜂鸣声

 

[阅读原文](https://simonwillison.net/2026/Nov/9/mysterious-beeps/)

 

现有资料无法确认原文完整，本页只翻译已取得的材料。

 

现有原件无法确认图片是否齐全。

 

我们家有一间储物小房间，里面堆满了上次搬家后一直没拆开的箱子。几周前，那间房里有什么东西开始*时断时续地发出哔哔声*。哔声间隔很长，站在房间里试着找出噪声来源让人很烦，我实在不想把那些箱子一个个翻遍。于是我让 Claude Code 构建了[Beep Locator](https://github.com/simonw/beep-locator)，一个利用散布在房间里的多台设备对神秘哔声来源进行三角定位的软件系统。

 

Beep Locator 运行一段时间后的样子如下：

 

![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?)".](/curation/media/cf4791ccc35effb9b5fdf52f4d0c03bf403a3e8a84efb8ae169e31bf087d79bf.webp)

 

运行一个 Python Web 服务器来显示主界面，然后用二维码或 URL 连接尽可能多的闲置设备，让它们充当监听器——我用的是两台 iPad、一部手机、一台 MacBook Pro 和一台 Surface Ultra。

 

接着，这些设备会互相播放声音，帮助估算彼此的位置。效果不太理想，所以我加了一个“粗略模式”，可以在空间中拖动设备图标来提供大致位置，系统随后会根据这些声音进行调整。

 

设置好之后，所有设备就会一起监听哔声！

 

我还添加了拍手模式，这样我可以在房间不同位置拍手来测试——拍手声在地图上显示为菱形。这让我更确信系统确实能够定位声音。

 

哔声会在地图上显示为 X，并在“已定位的声音”日志中新增一行。你可以依次从每台设备重放这些声音，确认它们是不是你要找的神秘哔声，然后点击“这就是那个神秘哔声”将其标记出来。

 

确认神秘哔声的频率后，系统就会监听它、测量哔声之间的间隔，并利用三角定位得到的位置，在地图上锁定最可能的地点。

 

系统按预期工作了。它给出的哔声位置误差约为 40 厘米；随后我翻找了那一堆特定的箱子，找到一个急需更换电池的老旧一氧化碳探测器。

 

我开始和 Claude 一起研究这个问题时，它很快找到了[BeepBeep：一种基于声学的高精度测距与定位系统，使用 COTS 设备](https://www.cs.purdue.edu/homes/chunyi/pubs/sensys106-beepbeep.pdf)，这是 Chunyi Peng、Guobin Shen、Yongguang Zhang、Yanlin Li 和 Kun Tan 于 2007 年发表的一篇论文。下面是该论文的摘要：

 

我们介绍了 BeepBeep 的设计、实现和评估。这是一种基于声学的高精度测距系统。它可在自发、临时组建的设备对设备场景中运行，无需依赖任何预先规划的基础设施。它是纯软件解决方案，只使用最基本的商用硬件——扬声器、麦克风以及某种设备间通信方式——因此可轻松应用于许多低成本传感器平台，以及大多数商用现成移动设备，例如手机和 PDA。它通过结合三种技术实现高精度：双向感测、自录音和采样计数。

 

这听起来正是我们要构建的东西！

 

Beep Locator 运行一个 Python Web 应用服务器，承担大部分工作。监听设备随后通过 WebSocket 连接到该服务器，并显示一个请求浏览器麦克风权限的界面。监听器主要通过录制最近 60 秒音频的缓冲区来工作。它们还运行一个简单的哔声检测算法（见 [detector.js](https://github.com/simonw/beep-locator/blob/main/beep_locator/modules/listener/detector.js)），利用快速傅里叶变换和高通滤波器识别可能的哔声，并将这些事件发送到主服务器。

 

报告检测到哔声时，服务器会让一台设备播放一声短促的啁啾声（选择与服务器往返时间最短的设备），然后要求每个监听器上传一段音频片段，范围从哔声前约 0.6 秒到啁啾声后约 0.8 秒。这个啁啾声能让各段音频彼此对齐，这是定位哔声的关键步骤。

 

我用 iPhone 通过 Claude Code Cloud 开始了这个项目，运行的是 Opus 5.5，并启用了 Extra thinking effort 模式。这里是[那个共享的初始会话](https://claude.ai/code/cshk_016BvfqAWf7MeGZKeYCrUnN2MmRfCSAX9Gu8DiptXMuH9P)，它从针对一个新建空 GitHub 仓库的以下提示开始：

 

`Write out a problem.md file describing the problem we want to solve`

 

`There is a device beeping in a room and I cannot find it`

 

`I want to set up several devices - laptops, phones, iPads - around the room all listening at the same time and have them help triangulate where the beep comes from`

 

`There needs to be a Python web app which coordinates it all - one device shows a web page for the app, other devices join a URL which turns them into listeners - all via browser WebAudio and WebSockets back to the Python server app`

 

`Ideally I wouldn't need to manually input the relative locations of the devices - it would be amazing if they could play sounds to each other in order to locate each other in 2D space - is that even possible though?`

 

这样我就得到了[这个 problem.md 文件](https://github.com/simonw/beep-locator/blob/main/problem.md)。整理这份文件时，Claude 找到并阅读了 BeepBeep 论文，文件中也介绍了这篇论文。

 

研究结果看起来不错，于是我告诉它：

 

`Ok try and build it, add a mechanism so you can send new code to the listeners which they will then run automatically - that way I can set everything up in the room and then leave you alone to continue hacking and experiment while I do something else`

 

这样我就[做到了这一步](https://github.com/simonw/beep-locator/commits/e36ac93a81091a246403c074e34c0041c6972fac)——系统大部分已经构建完成，但还没有实际运行过。

 

我把新仓库克隆到笔记本电脑上，启动了 Claude Code……随后[Fable 5.2 发布了](https://www.anthropic.com/claude-fable-and-mythos-5-2)，这个项目似乎是测试它能力的绝佳机会。

 

我让笔记本电脑上的 Claude Code 启动服务器，然后确保它既能看到发生了什么，*也*能在软件运行时实时修改它。

 

软件里已经内置了这个功能：Opus 5.5 为监听器实现了一个[installModule()](https://github.com/simonw/beep-locator/blob/44fea65c918fb31a7d2c0e17797ee1a106860e23/beep_locator/static/runtime.js#L710)方法，可以通过 WebSocket 连接触发，这意味着管理服务器能够在任何客户端上执行任意新代码。

 

在某些设备上，网页每次重新加载时，只要要使用麦克风监听，就会请求用户授权。热替换模块机制意味着我们可以部署新代码，而不必逐一手动操作每台监听设备。

 

从那时起，我主要就是坐在笔记本电脑旁，和 Fable 5.2 聊正在发生的情况，偶尔提出新功能需求。下面是我使用的一些功能提示：

 

`I think we need to make it so I can drag things around on the map in “rough mode”, where my job is just to put them roughly where they are, then switch out of rough mode and it attempts to get them accurate`

 

这样我就能在地图上拖动监听器了。

 

`what’s a good way for me to test this I wonder? Can we have it listen for claps, then I could clap and it could identify the location of the clap? [...]`

 

`Claps should use a different symbol on the map than beeps`

 

这样一来，每次我拍手，地图上都会显示一个与哔声不同的符号。

 

`each symbol on the map should include a HH:MM:SS timestamp`

 

这样就更容易看出哪个符号可能对应现实中的哪种声音。

 

`The log should show beeps and claps with their timestamps AND have a little play button which, when clicked, replays the recorded noise from each of the listeners in sequence (with clear text on screen showing which listener recorded which snippet) while temporarily turning off microphone recording while that replay plays`

 

现在我可以重放声音了，更容易辨认出哪段录音是我想找的神秘哔声。

 

`There should be a button next to a recording for “This is the mystery beep” - then I can hit replay to see and then confirm it was the mystery beep if that’s the one I am looking for`

 

`Then the system can categorize noises in the future to see if they are likely that same mysterious beep and use that information to build a more accurate idea of where it is`

 

此时我已经接近目标了——我大致确定了哔声的来源，但如果能把监听器重新摆到那个位置周围，进一步精确定位，岂不是很好？

 

`I want a feature for this, I don’t want to have to restart each listening device etc, I want to be able to click a “Reposition the devices” button which lets me switch into repositioning, then I click “Repositioned” and it puts me into Rough mode and asks me to roughly locate them, then I do that and click, then it starts up again. The previous session can be read-only viewed through the app.`

 

而且我还有一台闲置设备，于是接着说：

 

`add a feature where the map includes a spot that is a suggestion for a location that it would be useful to add a listener at - based on data collected so far`

 

我觉得这个项目最有意思的地方，是我证明了可以*让 Claude Code 长出耳朵*。

 

Claude 目前还没有原生音频输入，但它可以运行 JavaScript 和 Python 代码，分析麦克风采集的音频。

 

我让它运行一个带有 WebSocket 连接的 Web 服务器，以连接多台监听设备；接着让它在这些设备上运行 WebAudio 麦克风，并将它们接入系统，以便通过 WebSocket 向设备发送新的 JavaScript 代码执行。

 

之后我几乎可以放手让 Claude 自己处理问题、查询音频日志，并重新配置它的耳朵来帮助解决问题。

 

这让我想起几周前在 GitHub Universe 听说的一个类似做法：[Martin Woodward](https://github.com/martinwoodward)告诉我，他曾通过 USB-C 将[GitHub Universe Badge 电脑](https://simonwillison.net/2026/Oct/27/game-boy-color-on-my-conference-badge/)接到一台电脑上，再用网络摄像头对准它们的屏幕来调试，这样他的编码代理就能判断更新是否正常工作。

 

想办法让编码代理感知周围世界，真的很有趣。

 

标签：[projects](https://simonwillison.net/tags/projects)，[ai](https://simonwillison.net/tags/ai)，[generative-ai](https://simonwillison.net/tags/generative-ai)，[llms](https://simonwillison.net/tags/llms)，[claude](https://simonwillison.net/tags/claude)，[coding-agents](https://simonwillison.net/tags/coding-agents)，[claude-code](https://simonwillison.net/tags/claude-code)，[claude-mythos-fable](https://simonwillison.net/tags/claude-mythos-fable)

 

AI 翻译；具体表述请与原文对照。
