New Emscripten audioWorklet draft#7727
New Emscripten audioWorklet draft#7727Jonathhhan wants to merge 41 commits intoopenframeworks:masterfrom
Conversation
|
Could we use this approach for CORS and bundle that js file in the folder package?
https://stackoverflow.com/a/72628095
ping @Jonathhhan - any thoughts?
|
|
Hey @Jonathhhan could you give this a try and see if it solves the CORS issue? |
|
@ofTheo Yes, I will give it a try on Thursday. Maybe earlier.
But without Pure Data (libpd) Audioworklets work really well (at least I did not had any issues). |
Yes, it does work. Only flag I still need to set in the .htaccess file is: |
|
@Jonathhhan - that's awesome! |
|
@ofTheo maybe I first make a pr that solves the CORS issue? |
|
@ofTheo it seems that the recent |
|
Here is an updated branch: https://github.com/Jonathhhan/openFrameworks/tree/emscripten_3.1.57_audioWorklet |
|
On this should we just enable PTHEADS by default for libraries and proceed with this |
|
This draft should work as it is (without any additional changes). It works well, but maybe its not implemented nicely.
Besides that: The main downside is, that
sharedArrayBufferneeds to be enabled with-S USE_PTHREADSand because of that CORS header need to be set, if uploaded to a server: emscripten-core/emscripten#20454The
sharedArrayBufferand the otheraudioWorkletrelatedEmscriptenflags are also only needed, ifofSoundStreamis used.But what speaks for
audioWorkletsis, that it performs much better and the oldScriptProcessorNodemethod https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode is deprecated and will be removed at some point.Here is the main part of the implementation: https://github.com/Jonathhhan/openFrameworks/blob/audioWorklet-3/addons/ofxEmscripten/src/ofxEmscriptenSoundStream.cpp
Maybe this PR is good for testing and thinking about a proper implementation?