NikhilVerma/room-signal

A browser-based playground for tracing and hearing sound in 3D rooms.

0

stars

5

commits

TypeScript

primary language

Aug 23, 2026

updated

README

Room / Signal

Room / Signal is a browser-based room-acoustics playground. Upload or record a sound, place a speaker and either a headphone receiver or stereo microphone pair, choose a room, and hear the simulated recording.

Live demo: nikhil-verma.com/room-signal

Room / Signal with its built-in U-corridor experiment ready to play

The interface is currently desktop-only and supports viewports of at least 860 × 600. It intentionally occupies the full viewport and does not inherit the host website's page chrome or scrolling. See DESIGN.md before changing layout, controls, or styling.

The interface is an Astro website with a React application island and StyleX components. The acoustic solver combines exact geometric early paths with a three-dimensional Monte Carlo ray trace compiled from AssemblyScript to WebAssembly. The canvas is a top-down view of that 3D simulation.

Technology

  • Astro builds the standalone page and the version embedded in another Astro site.
  • React owns the interactive application state, audio controls, and room editor.
  • StyleX provides reusable, locally scoped components without leaking styles into a host website.
  • panzoom supplies familiar wheel, pinch, and empty-space panning instead of a custom camera interaction.
  • AssemblyScript and WebAssembly run the numeric acoustic kernel in the browser. assembly/room-acoustics.ts is compiled to a portable WebAssembly module; it intersects rays with arbitrary triangle meshes, transports eight frequency bands, estimates the late decay, and renders measured head responses.
  • Web Workers run that WebAssembly module away from the interface thread, so tracing 20,000 to 500,000 rays does not freeze the controls.
  • Web Audio decodes input audio and performs offline convolution. Native convolver normalization is disabled because the simulator owns the response level.

The AssemblyScript entry point used to be called u-room.ts because the first prototype only had a U-shaped room. That name became false once all presets shared the same mesh tracer. The engine is now assembly/room-acoustics.ts; room-specific mesh construction stays in public/room-simulator/room-acoustics-core.js.

What works

  • U-shaped corridor, shoebox, echo hall, cylinder, sphere, and ring rooms
  • draggable speaker and stereo microphones
  • headphone listening through 17 selectable HUTUBS head profiles
  • instant head-profile comparison from cached room paths
  • omnidirectional and cardioid source and microphone patterns
  • direct sound, early reflections, bounded corner diffraction, and a frequency-dependent late tail
  • frequency-dependent air absorption and scattering
  • three ray-count quality settings
  • uploaded audio or an in-browser microphone recording
  • optional looping, stereo playback, and WAV download
  • sampled ray paths for explaining echoes
  • a ready-to-play built-in experiment for first-time visitors

Every preset uses the same accelerated triangle-mesh tracer. Curved rooms use dense faceted meshes; mesh resolution and ray count are independent approximation controls.

Headphone mode applies a measured head-related response to every direct and early path according to its arrival direction and the listener's head angle. The current compact profile pack contains 19 measured directions per head, so the renderer selects the nearest direction. The late field is traced separately at the left and right ear positions. It is stereo but does not yet apply a measured head response to every stochastic late arrival. See public/room-simulator/hrtf/NOTICE.md for data provenance and attribution.

Run it

Use Node.js 22.19 or newer.

npm install
npm run dev

Open the local URL printed by Astro. To verify the solver and production bundle:

npm test
npm run build

Recompile the WebAssembly solver after changing assembly/room-acoustics.ts:

npm run build:wasm

Use it inside another Astro website

Room / Signal remains the source of truth. Its sync script copies only the simulator components, help content, isolated stylesheet, runtime assets, and social image into an existing Astro project:

./scripts/sync-to-astro-host.sh /path/to/astro-project

The Astro host owns its route, metadata component, package configuration, deployment settings, content, and history. The sync refuses a host without an existing src/pages/room-signal.astro, checks the required dependencies, verifies the copied files, and runs the host's production build. Use --check to detect drift without writing, or --skip-build when a later pipeline stage owns the build.

Accuracy boundary

This is a research-oriented exploration tool, not certified acoustic-design software. The early solver uses image-source paths for planar surfaces and direct plus first-order triangle reflections for curved meshes. The late field uses energy rays with one shared direction decision and an eight-band energy vector. Curves are faceted, corner diffraction is a bounded knife-edge approximation, and absolute level and late-tail calibration are still being validated.

The browser keeps uploaded and recorded audio on the local device. The application has no upload endpoint.

The built-in Echo pulse is generated by scripts/generate-demo-source.mjs, so it has no third-party audio or licensing dependency. Its checked-in room result lets a first-time visitor listen and inspect the traced paths immediately. Uploading or recording a sound replaces the demo in place.

See ARCHITECTURE.md for the solver boundary and CONTRIBUTING.md before changing the physics.

License

The application code is MIT licensed. The bundled HUTUBS-derived head-response data remains under Creative Commons Attribution 4.0; its authors, source, and transformations are recorded in public/room-simulator/hrtf/NOTICE.md. The bundled Barlow Condensed fonts remain under the SIL Open Font License included beside the font files.

Contributors

NikhilVerma

5 commits

NikhilVerma/room-signal

A browser-based playground for tracing and hearing sound in 3D rooms.

0

stars

5

commits

TypeScript

primary language

Aug 23, 2026

updated

README

Room / Signal

Room / Signal is a browser-based room-acoustics playground. Upload or record a sound, place a speaker and either a headphone receiver or stereo microphone pair, choose a room, and hear the simulated recording.

Live demo: nikhil-verma.com/room-signal

Room / Signal with its built-in U-corridor experiment ready to play

The interface is currently desktop-only and supports viewports of at least 860 × 600. It intentionally occupies the full viewport and does not inherit the host website's page chrome or scrolling. See DESIGN.md before changing layout, controls, or styling.

The interface is an Astro website with a React application island and StyleX components. The acoustic solver combines exact geometric early paths with a three-dimensional Monte Carlo ray trace compiled from AssemblyScript to WebAssembly. The canvas is a top-down view of that 3D simulation.

Technology

  • Astro builds the standalone page and the version embedded in another Astro site.
  • React owns the interactive application state, audio controls, and room editor.
  • StyleX provides reusable, locally scoped components without leaking styles into a host website.
  • panzoom supplies familiar wheel, pinch, and empty-space panning instead of a custom camera interaction.
  • AssemblyScript and WebAssembly run the numeric acoustic kernel in the browser. assembly/room-acoustics.ts is compiled to a portable WebAssembly module; it intersects rays with arbitrary triangle meshes, transports eight frequency bands, estimates the late decay, and renders measured head responses.
  • Web Workers run that WebAssembly module away from the interface thread, so tracing 20,000 to 500,000 rays does not freeze the controls.
  • Web Audio decodes input audio and performs offline convolution. Native convolver normalization is disabled because the simulator owns the response level.

The AssemblyScript entry point used to be called u-room.ts because the first prototype only had a U-shaped room. That name became false once all presets shared the same mesh tracer. The engine is now assembly/room-acoustics.ts; room-specific mesh construction stays in public/room-simulator/room-acoustics-core.js.

What works

  • U-shaped corridor, shoebox, echo hall, cylinder, sphere, and ring rooms
  • draggable speaker and stereo microphones
  • headphone listening through 17 selectable HUTUBS head profiles
  • instant head-profile comparison from cached room paths
  • omnidirectional and cardioid source and microphone patterns
  • direct sound, early reflections, bounded corner diffraction, and a frequency-dependent late tail
  • frequency-dependent air absorption and scattering
  • three ray-count quality settings
  • uploaded audio or an in-browser microphone recording
  • optional looping, stereo playback, and WAV download
  • sampled ray paths for explaining echoes
  • a ready-to-play built-in experiment for first-time visitors

Every preset uses the same accelerated triangle-mesh tracer. Curved rooms use dense faceted meshes; mesh resolution and ray count are independent approximation controls.

Headphone mode applies a measured head-related response to every direct and early path according to its arrival direction and the listener's head angle. The current compact profile pack contains 19 measured directions per head, so the renderer selects the nearest direction. The late field is traced separately at the left and right ear positions. It is stereo but does not yet apply a measured head response to every stochastic late arrival. See public/room-simulator/hrtf/NOTICE.md for data provenance and attribution.

Run it

Use Node.js 22.19 or newer.

npm install
npm run dev

Open the local URL printed by Astro. To verify the solver and production bundle:

npm test
npm run build

Recompile the WebAssembly solver after changing assembly/room-acoustics.ts:

npm run build:wasm

Use it inside another Astro website

Room / Signal remains the source of truth. Its sync script copies only the simulator components, help content, isolated stylesheet, runtime assets, and social image into an existing Astro project:

./scripts/sync-to-astro-host.sh /path/to/astro-project

The Astro host owns its route, metadata component, package configuration, deployment settings, content, and history. The sync refuses a host without an existing src/pages/room-signal.astro, checks the required dependencies, verifies the copied files, and runs the host's production build. Use --check to detect drift without writing, or --skip-build when a later pipeline stage owns the build.

Accuracy boundary

This is a research-oriented exploration tool, not certified acoustic-design software. The early solver uses image-source paths for planar surfaces and direct plus first-order triangle reflections for curved meshes. The late field uses energy rays with one shared direction decision and an eight-band energy vector. Curves are faceted, corner diffraction is a bounded knife-edge approximation, and absolute level and late-tail calibration are still being validated.

The browser keeps uploaded and recorded audio on the local device. The application has no upload endpoint.

The built-in Echo pulse is generated by scripts/generate-demo-source.mjs, so it has no third-party audio or licensing dependency. Its checked-in room result lets a first-time visitor listen and inspect the traced paths immediately. Uploading or recording a sound replaces the demo in place.

See ARCHITECTURE.md for the solver boundary and CONTRIBUTING.md before changing the physics.

License

The application code is MIT licensed. The bundled HUTUBS-derived head-response data remains under Creative Commons Attribution 4.0; its authors, source, and transformations are recorded in public/room-simulator/hrtf/NOTICE.md. The bundled Barlow Condensed fonts remain under the SIL Open Font License included beside the font files.

Contributors

NikhilVerma

5 commits

Languages

TypeScript

57.4%

JavaScript

37.5%

Astro

2.2%

Shell

2.1%