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 167 forks source link

Channel layout detection for the destination output device #2408

Open pmlt opened 4 years ago

pmlt commented 4 years ago

Describe the feature The current WebAudio API allows us to know the maximum number of output channels for a destination via AudioDestinationNode.maxChannelCount. However, this information gives us no indication of the nature of each channel (is it LFE?) and their ordering. For example, a value of "6" might mean a standard 5.1 setup, or it might mean standard 6.0, or just 6 arbitrary outputs.

Most platforms usually expose an OS-level API to obtain this information. It should be passed down to users of AudioContext.

Is there a prototype? No prototyping is possible.

Describe the feature in more detail On Windows, the WAVEFORMATEXTENSIBLE structure can be obtained for any output device. This structure contains a bitfield of channel positions.

On Mac, the kAudioDevicePropertyPreferredChannelLayout property can be used to obtain the channel layout.

On the Web Audio side, the information could be translated as an additional channelLayout enum on AudioDestinationNode. This enum would contain all possible values of the supported layouts in the Web Audio spec (https://webaudio.github.io/web-audio-api/#ChannelLayouts). I would suggest also adding 7.1 to this list at least, but perhaps this belongs in a separate issue.

padenot commented 4 years ago

TPAC 2020:

padenot commented 3 years ago

AudioWG virtual F2F: