[Csnd-dev] AudioWorklet

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd-dev] AudioWorklet

Michael Gogins-2
I see you have not touched your project on Csound as an AudioWorklet for a while. I also see that AudioWorklets are now on by default in Chrome 66. And I reviewed your discussion in the Web Audio issues.

What's the current status here? Is it now possible to transfer WASM into the audio rendering thread? Is anyone actively working on this?

Best, 
Mike
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] AudioWorklet

Steven Yi
I haven't had a chance to resume work on this, but had planned to do
so in the next week.  I stopped at the time as AudioWorklet was
unstable (breaking with different canary releases) and MessagePort had
not been implemented. Since then, Spectre changes have also disabled
ShareArrayBuffer from most browsers, removing some design
possibilities.  It seems to me that things have stabilized now with
AudioWorklet.

Last I left it, I followed the work of the Faust folks and base64
encoded the .wasm file and embedded it into JS.  This large string
then gets decoded at runtime and set as the binary for the WASM module
loader.  This works and, I think, is still the technique being used by
Faust and by the WebAudioModules folks.  The script for that is at:

https://github.com/kunstmusik/csound-audioworklet/blob/master/convert.sh

(I think Hlodver may also be using this technique to create his single
.js Csound include. )

Checking the WASM loaded was about as far as I got. The worklet node
and other things for AudioWorklet remains empty and needs to be
implemented, and CsoundObj needs to be updated to make whether
AudioWorklet or ScriptProcessor node is used transparent.

On Sat, Mar 31, 2018 at 6:24 AM, Michael Gogins
<[hidden email]> wrote:
> I see you have not touched your project on Csound as an AudioWorklet for a
> while. I also see that AudioWorklets are now on by default in Chrome 66. And
> I reviewed your discussion in the Web Audio issues.
>
> What's the current status here? Is it now possible to transfer WASM into the
> audio rendering thread? Is anyone actively working on this?
>
> Best,
> Mike
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] AudioWorklet

Michael Gogins-2
Thanks for the update. 

I am planning to do something this in the WebAssembly build of csound-extended. I suppose to expose the Csound API this way means treating all member methods as asynchronous and having them send messages over the port to the AudioWorkletProcessor that does the real work, at least when a return value is not needed.  That's simple enough. But this base64 stuff looks hackish.

Best, 
Mike

On Sat, Mar 31, 2018, 14:36 Steven Yi <[hidden email]> wrote:
I haven't had a chance to resume work on this, but had planned to do
so in the next week.  I stopped at the time as AudioWorklet was
unstable (breaking with different canary releases) and MessagePort had
not been implemented. Since then, Spectre changes have also disabled
ShareArrayBuffer from most browsers, removing some design
possibilities.  It seems to me that things have stabilized now with
AudioWorklet.

Last I left it, I followed the work of the Faust folks and base64
encoded the .wasm file and embedded it into JS.  This large string
then gets decoded at runtime and set as the binary for the WASM module
loader.  This works and, I think, is still the technique being used by
Faust and by the WebAudioModules folks.  The script for that is at:

https://github.com/kunstmusik/csound-audioworklet/blob/master/convert.sh

(I think Hlodver may also be using this technique to create his single
.js Csound include. )

Checking the WASM loaded was about as far as I got. The worklet node
and other things for AudioWorklet remains empty and needs to be
implemented, and CsoundObj needs to be updated to make whether
AudioWorklet or ScriptProcessor node is used transparent.

On Sat, Mar 31, 2018 at 6:24 AM, Michael Gogins
<[hidden email]> wrote:
> I see you have not touched your project on Csound as an AudioWorklet for a
> while. I also see that AudioWorklets are now on by default in Chrome 66. And
> I reviewed your discussion in the Web Audio issues.
>
> What's the current status here? Is it now possible to transfer WASM into the
> audio rendering thread? Is anyone actively working on this?
>
> Best,
> Mike