Replies: 4 comments 3 replies
-
|
I'm not actually sure what's going on here. I didn't think there was any blocking going on in the context initialization stuff so I'm kind of surprised there'd be an error in |
Beta Was this translation helpful? Give feedback.
-
|
It's not miniaudio doing blocking calls, it's ftxui, which is probably why it needs The miniaudio's Emscripten test, what compiler flag is it using? From the CMakeLists.txt it looks to be using mostly default flags? |
Beta Was this translation helpful? Give feedback.
-
|
Oh, I just learned about |
Beta Was this translation helpful? Give feedback.
-
|
Yes, just default flags. If you want to enable the Audio Worklets path, you need to add I had never heard of |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
I'm using miniaudio in an ftxui TUI app. Works great on desktop, now I'm trying to build using emscripten.
The audio fails to initialize and I tracked it down to somewhere in
ma_context_init__webaudio. Here I'm getting an error code from the JS script executed (resultFromJS = EM_ASM_INT)While I cannot step into the JS code from WASM I notice that the callstack is from a pthread, not main. And when I tried
windowin the developer console with the context of that thread there was nowindowobject.I tried to build without pthread (
USE_PTHREAD), but then ftxui failed, it appear to need threads to run its loop. I also tried to not build withPROXY_TO_PTHREADbut that lead to errors when ftxui start, about blocking main thread.I tried with
ASYNCIFYandALLOW_BLOCKING_ON_MAIN_THREADas well to see if that would allow the miniaudio webaudio init logic to run on main thread, but then I get another error from emscripten about blocking the main thread, which appear to be from ftxui's loop;I'm starting to wonder if miniaudio might not be compatible in emscripten builds that also builds ftxui.
I was wondering if my rambling above makes sense? This is an issue with miniaudio needing to be run in the main thread, not compatible with
PROXY_TO_PTHREAD?Beta Was this translation helpful? Give feedback.
All reactions