This post documents the second stage of my artistic research project “Sound Perspectives in Hyperrealistic Spaces” (funded by KUV, 2026–2028) at SDMK. Building on the AR/USDZ experiments described in Research 1, this niveau moves into a browser-based 3D environment with custom spatial audio.
Niveau 2: A Custom WebXR Viewer
Where Niveau 1 relied on Apple’s AR Quick Look and its built-in spatial audio, Niveau 2 takes full control. We built a standalone web viewer using Three.js for 3D rendering and the Web Audio API for spatial audio processing — no plugins, no app downloads, just a browser.
→ Open the Spatial Audio Viewer
The viewer loads a photogrammetry-scanned car from Kyrkö Mosse as a GLB (glTF binary) model. You can orbit around the car with your mouse or finger, and as you move, the audio responds in real time — panning left and right, fading with distance, and shifting in timbre as if you were walking around a physical sound source.
How the Spatial Audio Works
The spatial audio engine uses three Web Audio API nodes chained together to simulate how sound behaves in physical space:
StereoPannerNode — Calculates the horizontal angle between the camera and the sound source (the car’s driver seat) using atan2(), then maps that angle to a stereo pan value with sin(). As you orbit the car, the sound moves convincingly between your left and right ears.
GainNode — Implements distance-based volume rolloff. The closer you are to the car, the louder the sound. The gain follows an inverse-distance model with a reference distance and rolloff factor, creating a natural sense of proximity.
BiquadFilterNode (lowpass) — Simulates how high frequencies are absorbed over distance and by obstacles. When you’re close to the car (inside it, essentially), the full frequency spectrum is present. As you move away, a lowpass filter progressively removes high frequencies, creating the muffled quality of distant sound.
Pitch Shifting and Two Audio Layers
The viewer also uses playbackRate on AudioBufferSourceNode to create pitch shifts in discrete octave steps as you approach the car — the sound drops in pitch as you get closer, adding an uncanny, otherworldly quality to the experience.
Two separate audio tracks play simultaneously: a binaural stereo recording and a mono recording. Each responds independently to the spatial parameters, creating a layered sound field that shifts and evolves as you explore the car from different angles and distances.