W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2014

Re: Audio Workers - please review

From: Joseph Berkovitz <joe@noteflight.com>
Date: Thu, 11 Sep 2014 14:45:47 -0400
Cc: Chris Wilson <cwilso@google.com>, Norbert Schnell <Norbert.Schnell@ircam.fr>, Ehsan Akhgari <ehsan@mozilla.com>, "public-audio@w3.org" <public-audio@w3.org>
Message-Id: <6FFF6680-F160-46DE-B324-F283E64087B0@noteflight.com>
To: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>

On Sep 11, 2014, at 2:06 PM, Jussi Kalliokoski <jussi.kalliokoski@gmail.com> wrote:

> On Thu, Sep 11, 2014 at 9:01 PM, Joseph Berkovitz <joe@noteflight.com> wrote:
> Jussi,
> I agree the issue of importScripts overhead could be pretty major, if this overhead is in fact likely to be substantial. I am not knowledgeable about the extent to which browsers optimize imports of the same scripts in multiple workers. However it is almost a certainty that nodes will want to exploit substantial libraries.
> I did not see a convenient way in your proposed API to make it easy for different nodes based on the same worker to partition their ongoing computational state (maintained in between onaudioprocess callbacks) from each other, though. Did I miss something? Doesn’t there need to be a persistent per-node object that can hold this state?
> The state can for example be provided by a closure in the onaudionodecreated event handler, or using a global WeakMap that uses the AudioNodeHandles as keys. This makes sure that the state associated to the node is garbage collected when the node is.

I see.  Either of the above would work, but it feels like in this model the developer needs to do some more careful bookkeeping about state rather than just sticking state into the node’s dedicated global scope. That makes the approach feel more complex for developers to consume, relative to Chris’s proposal or the original ScriptProcessorNode.

Received on Thursday, 11 September 2014 18:46:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:14 UTC