[L2Ork-dev] Purr Data and Audio Worklet on the web

Jonathan Wilkes jon.w.wilkes at gmail.com
Mon Jun 1 20:57:02 EDT 2020


Hi all,

I was just reading about the Audio Worklet in Web Audio of browsers here:

https://developers.google.com/web/updates/2017/12/audio-worklet

And wrt Firefox here:

https://hacks.mozilla.org/2020/05/high-performance-web-audio-with-audioworklet-in-firefox/

Essentially you get a script or wasm module that runs on a *separate*
thread from the main browser thread. The interface includes a
bi-directional port so that the main thread and audio thread can talk
to each other. The Firefox blog entry talks a lot about how big a
reliability gain this (relatively) new interface is.

I think the idea is that this allows users to add nodes in a series of
filters or whatever in the Web Audio pipeline and get better
performance.

But I'm looking at the diagrams and just wondering if the entire Purr
Data binary compiled as wasm could be sitting in a single AudioWorklet
Node and its associated AudioWorklet Processor.

We've already got sched_audio_callbackfn used by portaudio. It seems
like that could be what gets called for the process() callback in the
Processor.

Two sticking points I see:

* I don't know if there's a way the Processor can get the system time
without communicating with the main thread

* I think the Processor block size is 128 while Pd's is 64.

Anyway, since both browsers have implemented this interface I think it
may be worth a discussion.

Best,
Jonathan


More information about the L2Ork-dev mailing list