-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emscripten #2
Comments
Hey claimred, thank you for the kind issue, I'm glad my code helped you! So for If that line fails, it should print an error to https://wiki.libsdl.org/SDL_OpenAudioDevice Specifies that:
What this means to me is that either If you use: Are they:
You may wish to change those values if they're not the same. The flag
See if you can change For this, I might want to make Thank you very much for bringing this to my attention, let me know if you get an error, or if the 0 also works, as I don't have emcc to test myself. Also TODO for me:
|
Yep, used that to change Sorry, I completely forgot to clarify what I meant by "won't work". There are no errors, yet the audio output freezes up after maybe a second or two of playing. Playing last "note" (maybe?) over and over again. Even the whole app tab freezes. This thing reproduces really weird. I got it tested on a couple of Win10 machines and on a Mac. Everything went 100% fine only on one Win 10 pc. Need to find a way to reproduce the bug reliably and provide you with a clear test case, not sure if it's an easy thing to do though. Also, it might be related to that emscripten-core/emscripten#3477 issue. I don't really understand what "floats" they are talking about, but maybe you will find something useful since you understand sound. |
I've closed this issue for now, because the new config value at the top should give more notice to users, and they can change it themselves, such as when using Emscripten. For simplicity of the library I can't added a check, but a user config makes more sense. If you can find a way to reproduce the bug reliably / real test case @claimred I can help delve deeper into the issue at hand, but my guess is that SDL2 can't convert some differing audio files based on your audio device of your machine, and it dies. |
Great example @jakebesworth! 👍 Really helped me to get audio working in SDL2 (SDL2_mixer is not available in emcc afaik)
One thing I noticed though is that it just won't work with Emscripten, tried playing around with your code and it seems that changing
SDL_AUDIO_ALLOW_ANY_CHANGE
toSDL_AUDIO_ALLOW_FREQUENCY_CHANGE
solved the issue, at least for Chrome, Edge and Safari. I don't know anything about how sound works, so I can't explain why.The text was updated successfully, but these errors were encountered: