Here is a video of the issue, as recorded on an Iphone X, running safari:
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)?