Re: ChannelMergerNode mixing semantics seem weird in dynamic situations

On Thu, Jan 17, 2013 at 5:41 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> On Fri, Jan 18, 2013 at 8:11 AM, Chris Rogers <crogers@google.com> wrote:
>
>> It's true that the behavior is tricky if the input(s) are changing
>> dynamically, so the developer would have to be careful to account for it.
>>  But, I believe it's well-defined.  I think in the vast majority of useful
>> cases, the inputs would be static in their channels and thus would present
>> a stable output.
>
>
> Yes, which is why I thought maybe eliminating the possibility of dynamic
> channel changes would be a reasonable thing to do.
>
>  To answer your question about what happens if input 0 has nothing
>> connected to it, it just doesn't influence the output at all and is skipped.
>>
>
> What if it has a GainNode connected to it, but the GainNode has no nodes
> connect to its input? Logically it seems to me that wouldn't influence the
> ChannelMerger output either. In that case we are basically saying that the
> output of a node can be zero channels ... is that accurate? If so, do all
> nodes (other than SourceNodes) produce zero-channel output when they have
> no inputs connected?
>
> This all of course needs to be in the spec :-).
>

Robert, sorry for the late reply - catching up...

The way I've intended it, and you're right that I need to be more clear in
the spec, is that any output of a node has at minimum 1 channel (mono).
 So, if a GainNode had nothing connected to it, then it would output 1
channel (of silence).  Sources such as AudioBufferSourceNode or
MediaElementAudioSourceNode would also output 1 channel (of silence) if no
.buffer has yet been set (or no .src).


>
> Actually I think the issues are even broader than ChannelMergerNode, since
> the number of channels a node is producing can be observed by its effects
> on upmixing with other nodes. I think that means we need to specify how
> many channels of output are produced by nodes at each point in time. For
> example, if we have an AudioBufferSourceNode whose buffer has 6 channels,
> and we call start(10) on it, then before time 10 is it producing 6 channels
> of silence or zero channels?
>

Good question.  I should be more clear in the spec.  My intention is that
the AudioBufferSourceNode outputs the number of channels of its
corresponding buffer, even if the start time has not yet been reached.  One
of the reasons for this is because the start time will, in general, fall
somewhere in the middle of a buffer (rendering quantum/tick).  So, I think
it's best to avoid having to re-jigger the channels anywhere other than the
start (or end) of a rendering quantum.


>
> Rob
> --
> Jesus called them together and said, “You know that the rulers of the
> Gentiles lord it over them, and their high officials exercise authority
> over them. Not so with you. Instead, whoever wants to become great among
> you must be your servant, and whoever wants to be first must be your
> slave — just as the Son of Man did not come to be served, but to serve,
> and to give his life as a ransom for many.” [Matthew 20:25-28]
>

Received on Tuesday, 5 February 2013 23:07:03 UTC