Checking inputs for connection

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
President
Noteflight LLC

49R Day Street
Somerville MA 02144
USA

"Bring music to life"
www.noteflight.com

---------- 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:
https://github.com/WebAudio/web-audio-api/commit/
e08792836f96612013ddc7c839c141d28c28a36f

Received on Friday, 18 November 2016 14:38:29 UTC