π Overview & Acoustic Principles
Acoustic propagation inside modern environments forms a highly complex physical process governed by the wave equation. Traditional virtual environments use simplified distance attenuation curves and coarse zone markers to represent audio spatialization. However, modern interactive media relies heavily on geometric acoustics (GA) to trace sound paths directly through architectural configurations. Sound behaves as a particle-wave hybrid at high frequencies, allowing wave propagation paths to be simulated using ray tracing. When sound encounters boundaries, it undergoes specular reflection, absorption, scattering, and transmission through materials.
Our physical simulator models several major phenomena in acoustics. Occlusion (Muffling) is the dampening of sound waves caused by solid geometry blocking the line-of-sight path between the source and listener. Reverberation (Echo) involves the reflection of acoustic energy off surfaces, decaying over time based on the materials' absorption coefficients. This can be estimated globally using Sabineβs formula:
$$T_{60} = 0.161 \times \frac{V}{\sum A_i \alpha_i}$$
where $T_{60}$ represents the time in seconds required for the reverberant field sound pressure level to decay by $60 \text{ dB}$, $V$ is the room volume, $A_i$ represents the surface area of boundaries, and $\alpha_i$ represents the absorption coefficient of each surface.
Transmission (Permeation) simulates sound passing directly through partition structures, experiencing high-frequency absorption and decibel attenuation according to Mass-Law approximations. Portals simulate acoustic energy escaping through openings (apertures) like doors and windows, causing the opening to act as a virtual point source radiating energy into adjacent spaces.
πΉοΈ How to Use the Simulation
Users can explore physical acoustics interactively by selecting five dynamic simulation scenarios. Click and drag the blue Listener icon ($\mathbf{π΅}$) or use the $\mathbf{WASD}$ / Arrow keys on your keyboard to navigate the physical field. Relocate the red Sound Source ($\mathbf{π}$ / $\mathbf{π₯}$) by clicking and dragging it directly inside the workspace. Toggle physical sound synthesis on or off using the **π/π Audio** switch in the control panel to listen to the simulated sound field in real time.
Use the interactive configuration sliders on the right to adjust parameters. Ray Count alters the geometrical density of the analytical ray bundle, tracing more reflection paths as the count increases. Frequency controls the pitch of the synthesized synthesizer voice, ranging from $200 \text{ Hz}$ to $1000 \text{ Hz}$ to demonstrate high-frequency absorption differences. Wall Absorption controls the percentage of energy absorbed on every surface bounce, dictating reflection decay and transmission coefficients. Click **Start Demo** to run an automated tour through all scenarios, modulating coordinates and displaying acoustic telemetry in real time. Pressing **Reset Baseline** instantly restores all sliders, coordinates, and configurations to standard values.
βοΈ Technical Architecture & Computational Logic
The application architecture separates the logical physics engine from the rendering layer and the Web Audio DSP pipeline. The simulation space is mapped onto a logical coordinate grid ($800 \times 600$ units) and scaled to fit the visual canvas based on high-DPI device pixel ratios ($DPR$). Geometrical raycasting utilizes parametric 2D vector segment-to-segment collision solvers:
$$T = \frac{(x_4 - x_3)(y_1 - y_3) - (y_4 - y_3)(x_1 - x_3)}{(x_4 - x_3)(y_1 - y_2) - (x_1 - x_2)(y_4 - y_3)}$$
$$U = \frac{(x_2 - x_1)(y_1 - y_3) - (y_1 - y_2)(x_1 - x_3)}{(x_4 - x_3)(y_1 - y_2) - (x_1 - x_2)(y_4 - y_3)}$$
For reflections, the incident ray angle rotates about the surface normal segment $\vec{n}$:
$$\vec{v}_r = \vec{v}_i - 2(\vec{v}_i \cdot \vec{n})\vec{n}$$
In the **Web Audio API** pipeline, sound generation is driven by four parallel oscillators producing a rich major 7th chord. The DSP chain routes these signals through a **BiquadFilterNode** (representing acoustic low-pass filtering from atmospheric and material damping) into separate **GainNodes** that manage stereo panning based on the sound's angle of incidence relative to the listener.
Material transmission loss ($TL$) in **Permeation** mode uses a physical Mass-Law formula approximation:
$$TL = 20 \log_{10}(d_w \cdot \alpha_w \cdot 10 + 1.2) \text{ dB}$$
where $d_w$ is the wall partition thickness and $\alpha_w$ is the absorption coefficient. The remaining energy ($E_{ratio} = 10^{-TL/20}$) scales the output volume, while three parallel feedforward feedback delay loops simulate physical early reflections. An **AnalyserNode** reads the final output wave, plotting it onto a responsive dark-mode oscilloscope.
π Future Directions & Scale Horizons
Future development will focus on optimizing raycasting performance and increasing simulation accuracy. Real-time geometric acoustic solvers can be computationally demanding on mobile platforms. Integrating 2D Hierarchical Quadtrees or Spatial Hashing will help optimize boundary collision checks, allowing the system to handle complex, multi-room structures with hundreds of virtual acoustic rays.
We also plan to model high-frequency diffraction using the Biot-Tolstoy-Medwin (BTM) physical model. This will allow sound to bend naturally around outer corners rather than being blocked entirely. Additionally, we plan to implement a multi-band DSP filter network to simulate frequency-dependent absorption. This will let users hear how materials like glass, concrete, wood, and dry-wall absorb high frequencies while allowing low-frequency bass to pass through.