Closed MichealReed closed 1 month ago
This would likely fix by initializing the capture device when the engine starts, but that would likely cause crashes in cases without a capture device, where only playback is desired.
Thanks. Are you able to check the dev branch? I wonder if this PR might fix this one: https://github.com/mackron/miniaudio/pull/888
Indeed looks fixed with that, thanks!!
I found a crash with the emscripten flow:
If I try to interact with the engine by playing a sound before the microphone notification has been triggered or before I interact once with the page, the error shows and the call to actually trigger the recording notification seems to crash.
If I click once in a random spot before trying to record (but before interacting with the engine otherwise after init and loading of a sound), it does not trigger this assertion. If I click to start recording immediately with this engine, it does not trigger the assertion. If the first click is to play a sound after my recorder has been created, the permission notification does not appear and the initialization call to the recorder crashes the whole engine.
I tried to build with -sASSERTIONS but I think it runs into a separate emscripten bug with ccall when this flag is enabled. The initialization logic is here: https://github.com/MichealReed/minisound/blob/f28148c7f33399e85cdb26afc0743c136e2158fd/minisound_ffi/src/src/record.c#L50