W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2016

Re: Checking inputs for connection

From: Hongchan Choi <hongchan@google.com>
Date: Fri, 18 Nov 2016 16:45:41 +0000
Message-ID: <CAGJqXNvMVBk8v-nyb=EB6MLb8whScN5dT9QtX_Yv-ckNZqx_bg@mail.gmail.com>
To: Joe Berkovitz <joe@noteflight.com>, Audio Working Group <public-audio@w3.org>
Thanks Joe!

We were also confused about the condition and you are correct. Should I
submit a PR for the fix?


On Fri, Nov 18, 2016 at 6:37 AM Joe Berkovitz <joe@noteflight.com> wrote:

Hi Hongchan,

I think I was perhaps looking at the wrong commit yesterday regarding #1078
and checking the inputs in the example for connection. I'm sorry about the
confusion, and to avoid any more I'm just posting a regular email.

The way that input connections are speced today as part of process(), a
completely disconnected input exhibits zero channels (*not* zero frames)
when passed to process(). Thus, one must check inputs[inputIndex].length to
see if the input numbered "inputIndex" is connected or disconnected.

Checking inputs[inputIndex][channelIndex].length will throw an exception if
the input is disconnected, since no channels will be present and
 inputs[inputIndex][channelIndex] will be undefined.

The reason inputs work this way is that for some nodes (e.g. ones using a
max-channel-count approach), a disconnected input has an undefined number
of channels according to the channel-configuration algorithms.

.            .       .    .  . ...Joe

Joe Berkovitz
Noteflight LLC

49R Day Street
Somerville MA 02144

"Bring music to life"

---------- Forwarded message ----------
From: *Hongchan Choi* <notifications@github.com>
Date: Thu, Nov 17, 2016 at 6:14 PM
Subject: [WebAudio/web-audio-api] Merge pull request #1078 from
hoch/955-vumeternode-example (e087928)
To: WebAudio/web-audio-api <web-audio-api@noreply.github.com>
Cc: Joe Berkovitz <joe@noteflight.com>, Mention <mention@noreply.github.com>

Merge pull request #1078 from hoch/955-vumeternode-example

Fix #955: Refining AudioWorklet examples.

At the teleconference on 11/17/2016, @joeberkovitz agreed to the change
proposed in the last [PR](8a04bf8).

You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
Received on Friday, 18 November 2016 16:46:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:33 UTC