Re: Question about channels and merger on destination

Peter,
I think this is the intended behavior, according to the docs: "There is a single output whose audio stream has a number of channels equal to the sum of the numbers of channels of all the connected inputs."

You can also check the method checkNumberOfChannelsForInput of AudioChannelMerger.cpp in webkit.
In order to use the merger as a panner for mono sources, I would use two gain nodes before the merger inputs, ad connect or disconnect the oscillators to/from these gain nodes.

var osc = context.createOscillator();
var merger = context.createChannelMerger(2);
var gainL = context.createGainNode();
var gainR = context.createGainNode();
osc.connect(gainL, 0, 0);
gainL.connect(merger, 0, 0);
gainR.connect(merger, 0, 1);
merger.connect(context.destination);
osc.noteOn(0);​

best
/Alessandro



On Jul 22, 2012, at 10:27 PM, Peter van der Noord wrote:

> Hmmm, when i add another osc to the other intput, they *do* get split up over left and right.
> 
> http://jsfiddle.net/e4b42/
> 
> Is this intended behavior?
> 
> Peter
> 
> 
> Does anyone know why i get stereo sound out of this example?
> http://jsfiddle.net/bJqkm/
> I have a merger with two inputs, connected to the destination, and i assume
> that whatever goes into merger in#0 goes to left, and in#1 goes to right,
> yet the oscillator i connect to an input of the merger sounds in stereo. Am
> i overlooking something?
> Peter

Received on Sunday, 22 July 2012 22:15:27 UTC