WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.05k stars 166 forks source link

Support Multi-channel PannerNode #2386

Open pmlt opened 3 years ago

pmlt commented 3 years ago

Describe the feature Support spatialization of multi-channel sources, either by lifting the restrictions on the number of input channels to PannerNode or by introducing a new kind of PannerNode specifically for this purpose.

Is there a prototype? Omnitone, Resonance do at least parts of what is described here as libraries.

Describe the feature in more detail

The use case: Game engines can produce a complete ambient 3D mix using a spherical channel configuration to represent 3D audio around the listener. Usually this channel configuration is 7.1.4 or 3rd to 5th-order ambisonics. When a user opts into 3D audio, we would want this mix to be properly binauralized to headphones using high-quality HRTFs.

Currently, this can only be accomplished by decoding the (for example, Ambisonics) source and simulating the virtual speakers by arranging a multitude of PannerNodes positioned to simulate the speakers around the listener. It would be much more user-friendly (and potentially more efficient) to only have to instantiate one PannerNode that can take the mix as-is and produce the same result.

rtoy commented 3 years ago

@hoch can provide more details, but Omnitone takes the Ambisonics source, splits out the channels and then applies the appropriate combining with a bunch of convolver nodes for the HRTFs to produce the binaural result. This is all done without a ScriptProcessorNode or AudioWorkletNode. Perhaps that's something we can specify in a new node.

hoch commented 2 years ago

TPAC 2022: There are some developer interests, but the use case might be too narrow.