Re: Question about channels and merger on destination

Thanks, i figured something like that.

Does anyone know if this is the destinationnode that does this, and not the
merger? as in:
- destination sees two channels coming in, sees that one is empty, decides
to put the active one over both L&R
and not:
- merger (with two input) sees one channel coming in, decides to make it
stereo


btw, what is the checkNumberOfChannelsForInput exactly?

Peter

2012/7/23 Alessandro Saccoia <alessandro.saccoia@gmail.com>

> 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:28:09 UTC