emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Inflexible web audio worklet module query

Open MatthieuMv opened this issue 1 year ago • 1 comments

I am using WebAudio API to spawn a worklet thread. The worklet module is resolved as a relative path and forces the web server to serve the file in the same url.

In my use case, I have a specific url prefix for all wasm files which is incompatible with generated emscripten module. I had to tape this using a post build script so that the url is resolved.

To fix this, I changed audioWorklet.addModule("MyModule.js"), to audioWorklet.addModule(locateFile("MyModule.js")).

I believe this is a valuable fix but if it's not, it means that there is a missing feature in this module to customise url prefix.

Thank you

MatthieuMv avatar Apr 26 '24 13:04 MatthieuMv

Yes, that sounds like a good fix. Would you be able to submit a PR perhaps?

sbc100 avatar Apr 30 '24 20:04 sbc100