emscripten-core / emscripten-core/emscripten

main .js cannot find the audio worklet .js file, if it's not in the root directory

Open
#20,316 1 comment 0 reactions 1 assignee Claimed by @juj View on GitHub
audio-worklets
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Hello! 👋
I'm working on an electron project that includes a cpp project compiled with emscripten, and which uses audio worklets. It works well!
However I have a little problem with this line:
https://github.com/emscripten-core/emscripten/blob/08cca043d8ba313d774bec8153fab66b70a6fe60/src/library_webaudio.js#L172

My project structure looks like:
```
root/
folder1/subfolder/
project.js
project.wasm
project.worker.js
project.aw.js
```
but addModule in project.js doesn't find project.aw.js, except if my project structure is:
```
root/
project.aw.js
folder1/subfolder/
project.js
project.wasm
project.worker.js
```
Do you think it would be possible to modify the line
` audioWorklet.addModule('{{{ TARGET_BASENAME }}}.aw.js').then(() => {`
as
` audioWorklet.addModule(locateFile('{{{ TARGET_BASENAME }}}.aw.js')).then(() => {`

Thanks :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.