About input/output channel counts

After reading the specification a few times, I'm still confused about how  
the number of input/output channels of each AudioNode is  
controlled/decided.

Here are a few slightly contradictory indications:

1)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioNode-section

The AudioNode interface does not expose the number of input/output  
channels, not is any such information mentioned in the text. This gives me  
the impression that an AudioNode must process the number of channels that  
is given to it (with up-mixing applied on fan-in), and output any number  
of channels that it want. However, this does not seem to be the case for  
all nodes...


2)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MixerGainStructure

This section mentions that "In cases where the channel layouts of the  
outputs do not match, an up-mix will occur to the highest number of  
channels.". Does this mean that the number of output channels of an  
AudioNode is controlled by the AudioNode itself (e.g. based on what kind  
of processing it does or possibly the number of channels in the input  
signal), regardless of what its output is connected to?


3)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioContext-section

The AudioContext.createJavaScriptNode() method takes the arguments  
numberOfInputChannels and numberOfOutputChannels. I guess that this means  
that up-mixing/down-mixing will be applied to the input of the  
JavaScriptAudioNode to make it match the numberOfInputChannels property?

Is there a similar (hidden) property for all other AudioNodes (e.g.  
DelayNode)?


4)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioGainNode

The AudioGainNode section says: "The number of channels of the output will  
always equal the number of channels of the input". In other words, the  
number of output channels is controlled by the number of input channels.  
This is different from e.g. the JavaScriptAudioNode and the  
AudioPannerNode.


5)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Convolution-reverb-effect

Figures 3 and 6 indicate that the number of output channels are NOT  
controlled by the number of channels in the convolver impulse response.  
What controls the number of outputs?


6)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioPannerNode

The spec for the AudioPannerNode mentions: "The audio stream from the  
input will be either mono or stereo, depending on the connection(s) to the  
input."

This is a bit unclear, and could for instance mean that the input signal  
will be mono for mono input, or down-mixed to stereo for inputs with >= 2  
channels?

Furthermore, "The output of this node is hard-coded to stereo (2 channels)  
and currently cannot be configured.". Thus for the AudioPannerNode at  
least, the number of output channels is fixed.


7)  
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioChannelSplitter

This section mentions: "It has a single input, and a number of "active"  
outputs which equals the number of channels in the input audio stream."

This indicates that the the AudioChannelSplitter node has a flexible  
number of input channels, probably given by the number of channels of the  
connected input signal (and, I take it, with up-mixing applied in the  
fan-in case).


.....


So, I guess that this boils down to two question:

- What controls the number of input channels of an AudioNode?

- What controls the number of output channels of an AudioNode?


/Marcus

Received on Monday, 18 June 2012 07:42:02 UTC