Re: Comments on AudioWorklet examples

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.

Best,
Hongchan

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