[ Project 01 ] Proof of concept · side project October 2026

Depth→Sound

Navigation aid · working title

A browser app that turns a webcam into spatial audio, so you can hear where obstacles are.

Role
Solo: research, design and implementation
Status
Working proof of concept
Runs on
Chrome / Edge, desktop
Hardware
A webcam and headphones
Demo: put headphones on to hear the spatial audio
Watch demo ↑ Code [link] ↗ X post [link] ↗
(01)

Why I built it

A proof of concept and a playground. I wanted to see how far you can get with a laptop webcam, a free open-source depth model and a pair of headphones. Could you hear the shape of a room?

It was an excuse to get hands-on with tech I hadn’t combined before: monocular depth estimation, AI inference running entirely in the browser on WebGPU, and 3D spatial audio. Navigation for blind and low-vision people was the idea that tied it together, and a good reason to take the safety side seriously, even in a side project.

(02)

How it works

Like a car’s parking sensor, but for walking, and with directional sound.

  1. 01 Capture Grab a frame from the webcam.
  2. 02 Estimate depth Depth Anything V2 Small predicts relative depth for every pixel from one ordinary camera, with no lidar or stereo.
  3. 03 Split into sectors An eye-level band is cut into 5 or 7 vertical sectors. Each sector’s closeness is its 95th-percentile depth value.
  4. 04 Choose what to play Only sectors past a closeness cutoff make sound: by default just the 2 closest, to avoid sensory overload.
  5. 05 Play spatial audio Each sector has its own HRTF-placed beep across a ±75° arc. Beeps speed up from 1 per second to one every 80 ms as an obstacle gets closer.

camera → depth model → sectors → selection → beep timing → spatial audio

Cutoff
L3L2L1CR1R2R3
Playing: the 2 closest sectors past the cutoff Past the cutoff, held back by the 2-voice limit Silent Illustration: 7 sectors across ±75°, bar height = closeness
(03)

Stack

  • TypeScript
  • Transformers.js
  • Depth Anything V2 Small
  • WebGPU / WASM
  • Web Audio API (HRTF)
  • Vite
  • Vitest
(04)

Technical highlights

Core safety rule

“Silence must never mean all clear.”

If the model stops producing results for 500 ms, a distinct alarm plays. A second check catches main-thread freezes the timer can’t see. A pause cue plays before audio stops when the tab is hidden, a screen wake lock keeps the device awake, and the volume slider can’t mute the alarms.

01

AI inference in the browser

Transformers.js runs the ONNX model on WebGPU in fp16, falling back to 8-bit WASM on machines without WebGPU. Video never leaves the device, with no server or install.

02

Sample-accurate audio scheduling

Beeps are scheduled ahead on the audio clock (20 ms tick, 60 ms lookahead), so the rhythm stays steady when frame rate varies, with no stutters or catch-up bursts.

03

Latency measurement

Every frame logs capture, inference, processing and audio timing. The app shows median and p95 latency and exports sessions as CSV, so frame-to-sound delay can be measured.

04

Testable architecture

All decision logic (sector math, voice selection, beep timing, watchdog, statistics) lives in pure TypeScript modules, covered by 43 passing unit tests.

05

Live tuning

A control panel adjusts sector count, cutoff, max voices, beep speed range, arc width, pitch mode and volume while the app runs.

[SCREENSHOT: CONTROL PANEL]
Back to projects Get in touch