W3C home > Mailing lists > Public > public-audio@w3.org > April to June 2016

Re: Comments on AudioWorklet examples

From: Hongchan Choi <hongchan@google.com>
Date: Mon, 30 May 2016 15:31:14 +0000
Message-ID: <CAGJqXNso9yc8qA-OEkNs8oTgDV4yzeVSn3DzpbhGQtNDV=Txdw@mail.gmail.com>
To: Joe Berkovitz <joe@noteflight.com>
Cc: Audio Working Group <public-audio@w3.org>
Hi Joe,

Thanks for the VU meter example!

- What is the best way to package JS definitions that can be used in both
> threads (like constants for default values)? I forget, can Worklet scripts
> themselves import scripts? Hope so!

I don't think it is possible because `import` can only happen in the main
thread. Note that the worklet scripts is evaluated within
WorkletGlobalScope, which cannot access the `import` method.

> - We appear to be providing AudioContextInfo to an AudioWorkletProcessor
> both at construction time and in the process() method. Is this necessary?
> What if one needs to refer to some contextual information in, say, an
> onmessage() call? (This actually comes up in the example, which wants to
> use the sample rate to do some units conversion.)

AudioContextInfo has the current playback time. I think this is necessary.

Received on Monday, 30 May 2016 15:31:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 30 May 2016 15:31:51 UTC