Hi!
I’m making a mobile web-game using webgl in javascript, and I’m using the latest FMOD Studio javascript builds (currently using upstream/wasm) and I’ve been getting some audio cracking on “slower” & older devices and I’m trying to figure out why what’s going on. I undestand it’s likely a CPU bottleneck or a weird web-browser throttle behaviour, but I’m getting a bit desperate on figuring out why.
Here is a video of the issue, as recorded on an Iphone X, running safari:
https://www.dropbox.com/s/uq5w1lqq9eapn5k/fmod%20cracking%20server.mp4?dl=0
At the begining of the video, I visit a locally-hosted server (using Five server, but I have also tried python3’s http.server with the same result) where the game runs acceptably at 50~ FPS and it sounds OK.
Then I switch to a tab to my github pages https://fonserbc.net/lillium where the game still runs at the same FPS but the audio cracks for an unknown reason to me.
I’ve tried using different builds of the FMOD api, bringing the DSP buffer buffer size up to 2048x4 (I don’t really need a very fast-reactive buffer), but I have very similar results.
I know the issue is somehow related to performance because if I remove some of the game elements (like the pedestrians) I eventually get to a version where the audio doesn’t crack.
But I have had this happen even on a newer Iphone 13, and I’m getting occasional short cracks on my windows 11 desktop computer running firefox, so I’m afraid is something not fully related to CPU usage.
You can try find the game files at https://github.com/Fonserbc/Fonserbc.github.io/tree/master/lillium
And the github hosted game at https://fonserbc.net/lillium
I’ve been testing with hosting it on itch (with their html5 hosting) and I have the same issue there as I have on my github pages.
The FMOD project build is a “mobile” build which barely has 4 tracks playing at the same time at any given moment, but at the sections of the beginning of the game where I recorded this video it’s not even 2 tracks.
Any clues? Is it possibly something related to the FMOD build (upstream vs fastcomp, or wasm vs other things)?