展示HN:Outside In – 将外面的夜间声音实时传输到床边。iOS/免费
大家好,我开发了一个名为 Outside In 的小型 iOS 应用(<a href="https://apps.apple.com/us/app/outside-in/id6759529344">https://apps.apple.com/us/app/outside-in/id6759529344</a>)。
这个想法很简单:你可以把一部闲置或旧的 iPhone 放在户外(如门廊、窗台或后院),而将另一部放在床边。户外的手机会捕捉外面的声音——如蟋蟀、雨声、风声,偶尔还有猫头鹰的叫声——并通过本地 Wi-Fi 将这些声音传输到室内的手机上。你可以将室内手机翻面放下,伴着这些声音入睡。
我之所以开发这个应用,是因为我和我的伴侣以前晚上会把窗户留一条缝,以便听到外面的声音,但外面的温度并不总是适合这样做。我希望能在不受天气影响的情况下,享受开窗时的声音。
一些技术细节:
这两部手机通过 Bonjour(NWListener/NWBrowser)相互发现,然后通过简单的 TCP 连接以长度前缀的格式流式传输 PCM 音频。音频为 48kHz 单声道 Float32。没有服务器,没有互联网,所有数据都保留在本地网络中。
应用中有一个语音抑制功能,利用苹果的 SoundAnalysis 框架在设备上检测人声并将其屏蔽。它使用一个滞后门控,关闭时的置信度阈值约为 55%,重新开启时约为 30%,并设有 3 秒的保持时间,以避免声音的抖动。增益的提升是按缓冲区呈指数级的,以避免点击声。效果出乎意料地好。人行道上的对话会被抑制,但你仍然能听到蟋蟀的声音。
室内手机使用加速度计检测其是否面朝下且静止(重力.z > 0.85 + 1.75 秒静止缓冲),然后逐渐增强音频。当你拿起手机时,音频会逐渐减弱。整个交互模型基本上是“放下它,忘记它”。
没有账户、没有云服务、没有分析、没有录音。零外部依赖。全部使用苹果的框架。免费,无广告,无内购等。我是为自己开发的,觉得其他人也可能会需要这个应用。
欢迎提问(不可避免会有人问“我为什么要在 X 城市听外面的声音?” :))
查看原文
Hey HN. I built a small iOS app called Outside In (<a href="https://apps.apple.com/us/app/outside-in/id6759529344">https://apps.apple.com/us/app/outside-in/id6759529344</a>).<p>The idea is simple: you put a spare/old iPhone outside (porch, windowsill, backyard) and keep the other one by your bed. The outside phone captures whatever's happening out there — crickets, rain, wind, the occasional owl — and streams it to the inside phone over your local Wi-Fi. You flip the inside phone face-down and fall asleep to it.<p>I built this because my partner and I used to leave a window cracked at night to hear the outside, but the outside temperature isn't always compatible with that. I wanted the sounds sleeping with the window open without the weather.<p>Some technical details:<p>The phones find each other via Bonjour (NWListener/NWBrowser), then stream PCM audio over a plain TCP connection with length-prefixed framing. 48kHz mono Float32. No server, no internet. Everything stays on the local network.<p>There's a speech suppression feature that uses Apple's SoundAnalysis framework to detect human voices on-device and gate them out. It runs a hysteresis gate with ~55% confidence threshold to close and ~30% to reopen, with a 3-second hold time so it doesn't flutter. The gain ramping is exponential per-buffer to avoid clicks. It works surprisingly well. Conversations on the sidewalk get suppressed but you still hear the crickets behind them.<p>The inside phone uses the accelerometer to detect when it's face-down and still (gravity.z > 0.85 + a 1.75s stillness buffer), then fades audio in. Pick it up and it fades out. The whole interaction model is basically "put it down and forget about it."<p>No accounts, no cloud, no analytics, no recording. Zero external dependencies. All Apple frameworks. Free, no ads, no IAP etc. I built it for myself and figured others might want it too.<p>Happy to answer questions (inevitably some folks who would say "why would I want to listen to outside in X city?" :)