-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Emscripten audioWorklet draft #7727
base: master
Are you sure you want to change the base?
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 |
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
sharedArrayBuffer
needs to be enabled with-S USE_PTHREADS
and because of that CORS header need to be set, if uploaded to a server: emscripten-core/emscripten#20454The
sharedArrayBuffer
and the otheraudioWorklet
relatedEmscripten
flags are also only needed, ifofSoundStream
is used.But what speaks for
audioWorklets
is, that it performs much better and the oldScriptProcessorNode
method 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?