Re: Four channel output with ChannelMergerNode

On Sun, Apr 28, 2013 at 7:16 AM, Michael Barton
<michael.barton10@gmail.com>wrote:

> 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.
>

Sorry, I meant "speakers" instead of "stereo".  If you give me the entire
code example, I can try to have a look. As an alternative to setting the
merger attributes, you can also try setting them on the gain nodes
themselves, which should have the same effect.


>
>
> 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 19:35:47 UTC