Ray-Traced Audio Interactive Simulation

A real-time geometric acoustics analyzer exploring physical sound propagation, wave interference, and auditory feedback models.

Configuration

Select Scenario

Simulation Parameters

Player (Drag) Sound Source (Drag) Unobstructed Ray Obstructed Ray

Live Diagnostics

Continuous Occlusion 0%
Avg. Reflection Path 0 px
Transmission Loss 0.0 dB
Aperture Escape Vector 0.00

Acoustic Waves (Oscilloscope)

Scientific & Technical Documentation

📚 Overview & Acoustic Principles

Unlike traditional game engines that rely on hardcoded "room boxes" or uniform ambient volumes, ray-traced audio dynamically maps geometrical acoustics in real time. Sound waves are treated as geometrical wave packets (acoustic rays) emitted from a source, allowing the system to approximate physical wave behaviors like occlusion, specular reflection, transmission loss, and aperture diffraction [1].

This dashboard maps four critical physical phenomena. Occlusion (Muffling) models the obstruction of direct line-of-sight sound rays, simulating acoustic shadowing [1]. Rather than a binary state, this is evaluated continuously using directional fan casting. Reverberation (Echo) measures the decay of sound energy as wave packets bounce off boundaries, governed by the absorption coefficients of surrounding surfaces [1]. Transmission (Permeation) simulates wave energy passing directly through dense partitions, shedding power according to material mass [1]. Finally, Aperture Diffraction (Portaling) calculates how openings like windows and doors act as secondary point-sources, routing environmental sound fields elegantly into interior spaces [1].

đŸ•šī¸ How to Use the Simulation

Interact directly with the simulation workspace using your mouse or touch gestures. Toggle between the five physical scenarios using the configuration list on the left to see how rays bend, bounce, and permeate the boundaries.

Click and drag the blue icon (đŸ”ĩ) to move the listener (Player), and drag the red pulsing icon (🔊/đŸ’Ĩ) to relocate the Sound Source. Toggle physical sound synthesis using the "Audio OFF/ON" button. Move the sliders to adjust physical parameters: Ray Count alters the geometrical tracing density, Frequency shifts the oscillator pitch with smooth continuous portamento, and Wall Absorption controls energy attenuation during bounces. Toggle ⚡ Start Demo to initiate an automated, orbital sweep that demonstrates all modes hands-free.

âš™ī¸ Technical Architecture & Computational Logic

The core visualizer executes 2D geometrical ray-casting calculations on a normalized logical coordinate grid ($800 \times 600$ points) mapped onto a responsive physical viewport. The line-segment intersection solver evaluates parametric vector collisions:

T = (A x B) / D && U = (C x D) / D

The audio pipeline runs on Web Audio API nodes. Standard synthesizer voices generate continuous harmonic tones that flow into a real-time BiquadFilterNode (lowpass) and discrete panning channels. Reflections are modeled physically using three parallel DelayNodes set to unique, feedback-moderated delay loops. Their delay times and gains are continuously modulated by the calculated average ray path lengths. Real-time visual waveforms are extracted via an AnalyserNode and painted onto an oscilloscope display, offering detailed visual feedback even when muted.

🚀 Future Directions & Scale Horizons

Future updates will focus on optimizing computational speeds and expanding the physics engine. Standard raycasting can become performance-heavy with higher segment counts. We plan to integrate 2D Hierarchical Voxel Grids or Signed Distance Fields (SDFs) to skip redundant ray-intersection calculations in complex scenes.

We also plan to expand the sound model. This includes calculating high-frequency edge-diffraction using the Biot-Tolstoy-Medwin (BTM) physical model and adding presets for real-world materials (concrete, carpet, oak wood) to determine absorption and transmission loss across distinct frequency bands.

Explore More Spatial Tools & Neuro-Simulations