You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When emscripten is run in javascript strict mode (such as when STRICT_JS is enabled), and SDL audio is played using an audio element (such as preloaded audio with --use-preload-plugins), then the audio onended event attempts to set the read-only property paused of the audio element. This is not allowed in strict mode, and results in an error. As a result, the audio is not cleaned up and SDL will run out of channels.
Compiling with emcc main.c -s USE_SDL=1 --use-preload-plugins --preload-file=test.wav -o main.html and clicking the canvas does not result in an error, as emscripten is not in strict mode.
Compiling with emcc main.c -s USE_SDL=1 -s STRICT_JS --use-preload-plugins --preload-file=test.wav -o main.html and clicking the canvas results in Uncaught TypeError: setting getter-only property "paused" when the audio ends. Clicking enough times will eventually result in the error All 32 channels in use! being logged and no further audio can be played.
The text was updated successfully, but these errors were encountered:
Version of emscripten/emsdk:
When emscripten is run in javascript strict mode (such as when
STRICT_JS
is enabled), and SDL audio is played using an audio element (such as preloaded audio with--use-preload-plugins
), then the audioonended
event attempts to set the read-only propertypaused
of the audio element. This is not allowed in strict mode, and results in an error. As a result, the audio is not cleaned up and SDL will run out of channels.Example code:
Compiling with
emcc main.c -s USE_SDL=1 --use-preload-plugins --preload-file=test.wav -o main.html
and clicking the canvas does not result in an error, as emscripten is not in strict mode.Compiling with
emcc main.c -s USE_SDL=1 -s STRICT_JS --use-preload-plugins --preload-file=test.wav -o main.html
and clicking the canvas results inUncaught TypeError: setting getter-only property "paused"
when the audio ends. Clicking enough times will eventually result in the errorAll 32 channels in use!
being logged and no further audio can be played.The text was updated successfully, but these errors were encountered: