Fwd: Four channel output with ChannelMergerNode

Didn't cc in mailing list.

---------- Forwarded message ----------
From: Michael Barton <michael.barton10@gmail.com>
Date: Wed, May 8, 2013 at 7:50 PM
Subject: Re: Four channel output with ChannelMergerNode
To: Chris Rogers <crogers@google.com>


I've put up the code in a gist: https://gist.github.com/mbarton/5542642 and
a live demo up at http://mbarton.me/cue_test.html.

In both versions, I've moved to setting the channelCount=2,
channelCountMode=explicit and channelInterpretation=speakers on each gain
node rather than on the merger, but the result is the same and I end up
with the main output on the first 2 channels but the cue output on all 4.

If you could have a look and see if I'm doing anything strange that would
be great.

Thanks,

Michael


On Sun, Apr 28, 2013 at 8:35 PM, Chris Rogers <crogers@google.com> wrote:

>
>
>
> 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 Wednesday, 8 May 2013 18:51:46 UTC