How to Create Binaural 3D Audio Scenes in Your Browser
Learn how HRTF binaural panning works, how to place and move sounds around a listener, and when to export binaural stereo or first-order ambisonics.

Stereo versus spatial
Ordinary panning only moves a sound between left and right. Our ears locate sounds in a full sphere, using tiny differences in arrival time and level between the ears and the way the outer ear filters sound from each direction. These cues are captured in head-related transfer functions, HRTFs. Apply the right HRTF to a mono sound, play it over headphones, and the brain hears it in a place: behind you, above you, or passing from one side to the other. That is binaural audio.
Ambisonics is a related idea for speakers and VR. Instead of baking the sound into two ears, it stores the whole sound field in a set of channels that a decoder can later render for headphones, a speaker ring or a 360 video player that turns with your head.
Building a scene
The Spatial Audio 3D Panner shows a top-down map with the listener in the centre, facing up. Add your sounds as files or start with a test sound. Pink noise and clicks are ideal for learning, because broadband sounds carry the strongest direction cues. Pure tones are the hardest to place.
Drag each dot to a position. The info line tells you the azimuth (angle around you, positive to the left), the elevation and the distance. Raise a source with the height slider; elevation cues are subtle on generic HRTFs, so combine height with movement for a clear effect.
Distance
Loudness falls as a source moves away. The panner uses the inverse distance model of the Web Audio API: at the reference distance the level is unchanged, and with a roll-off of 1 the level halves each time the distance doubles beyond it. Increase roll-off for close, intimate scenes and decrease it for wide landscapes where distant sounds should stay audible. There is no reverb, so very distant sounds still sound dry; add room ambience in your editor afterwards if needed.
Movement makes it convincing
A sound that sits still behind you is easily heard as in front, because generic HRTFs do not match your ears exactly. Moving sources resolve that confusion. You can:
- Generate an orbit, a full circle around the head in eight seconds.
- Make a fly-by from left to right in front of the listener.
- Make an approach from the edge of the map to just in front.
- Record a path by pressing Record and dragging the source while the scene plays.
Recorded paths store positions about ten times a second and play back smoothly, with straight lines between the stored points.
Checking on headphones
Always judge binaural scenes on headphones. Closed or open headphones both work; earbuds work too, though some lose low-end weight. Listen for whether the sound feels outside your head, whether the motion is smooth, and whether any source is too loud when it passes close by. If one source dominates, lower its level or start it farther away.
Exporting
- Binaural stereo WAV is the finished headphone mix. Use it in podcasts, ASMR videos, audio dramas and meditation tracks. The render uses the same HRTF panner as the preview and is scaled down automatically if it would clip.
- Ambisonics AmbiX WAV has four channels, W, Y, Z and X, with SN3D normalisation. Load it into an ambisonics decoder plugin, a game engine or a 360 video workflow. Because the file contains the sound field rather than ear signals, the viewer's head turns can rotate it later.
Tips for better results
Keep important dialogue near the front and slightly off centre, where localisation is most reliable. Use movement sparingly so listeners do not tire. Mix the scene at a moderate level; binaural tricks become less effective when everything is loud. Finally, tell your audience to wear headphones, because on speakers binaural audio sounds like strange equalisation rather than space.



