Re: Four channel output with ChannelMergerNode

Cool thanks, just tried that out. Now playing through the main gain node
works but playing through the cue node causes output on all 4 channels.

ctx.destination.channelCount = 4;
ctx.destination.channelCountMode = "explicit";
ctx.destination.channelInterpretation = "discrete";

merger = ctx.createChannelMerger(2);
merger.channelCount = 2;
merger.channelCountMode = "explicit";
merger.connect(ctx.destination);

Can you elaborate on setting the an attribute to "stereo" on the merger? I
tried that with channelInterpretation but got InvalidStateError. Setting it
to either speakers or discrete leads to output on all 4 channels from the
cue gain node.


On Sat, Apr 27, 2013 at 6:58 PM, Chris Rogers <crogers@google.com> wrote:

>
>
>
> On Sat, Apr 27, 2013 at 7:54 AM, Michael Barton <
> michael.barton10@gmail.com> wrote:
>
>> Hi all,
>>
>> I've been trying to get a DJ app style 4 channel output (1 stereo main, 1
>> stereo cue) test working in Chrome Canary. I get audio out for the main but
>> nothing for the cue channel..
>>
>> Code I'm trying out:
>>
>> ctx = new webkitAudioContext();
>> ctx.destination.channelCount = 4;
>> merger = ctx.createChannelMerger(2);
>> merger.channelCount = 4;
>> merger.channelCountMode = "explicit";
>> merger.channelInterpretation = "discrete";
>>
>
> You want those attributes to be set on the ctx.destination and not the
> merger, otherwise each input of the merger gets upmixed to 4 channels, and
> since you have two inputs each with four channels it will output 8 channels.
>
> For the merger you might want to set the attributes as: 2, "explicit",
> "stereo"
>
>
>> merger.connect(ctx.destination);
>>  main = ctx.createGainNode();
>> main.connect(merger, 0, 0);
>>
>> cue = ctx.createGainNode();
>> cue.connect(merger, 0, 1);
>>
>> I've checked the hardware using a couple of other programs and that's
>> working so I don't think the sound-card itself is broken.
>>
>> Any suggestions on how to debug this would be greatly appreciated.
>>
>> Thanks,
>>
>> Michael
>>
>
>

Received on Sunday, 28 April 2013 14:17:08 UTC