Hey! I've been trying to make a game I'm working on for the GX.games platform run on both PC and mobile. Things have worked like charm so far!
There is just one thing that continues to plague me due to the platform difference.
Not on pc, but on mobile, whenever I minimize the app, and then open another app, the audio in game just completely stops!
It works just fine if you don't open another app and immediately reopen the game though, funnily enough.
I checked the audio debug overlay, and it looks as though the sound just STOPS!.. Not like, the whole "audio stop sound" kind where it turns cyan on the overlay and then disappears right away.. Not yet, anyways.
Actually, the background song stays white but stops moving through the "pos" hex code, then one SFX audio can get stuck on cyan (stopping) and remains in the debug, and the rest that try to play get stuck on magenta (marked for playing soon but waiting on "initial conditions"), and then no sounds play at all 😭
I'd love for my game to be able to pick its audio back up even if the player pauses to check their text messages or whatever.
Here's what I tried:
os_is_pausedto audio pause all if true and audio resume all if false (this is what made it work after closing and reopening the app originally, but this same fix does not carry over if you open another app before reopening.)- Also attached an
audio_group_load(audiogroup_default)just in case the problem was that theaudio_group_is_loaded(audiogroup_default)returned false and it was the problem. It was not the culprit. - Tried making it only attempt to resume audio after interacting, since it only plays audio once you tap the screen first on mobile, but it still waits to play it.
- Tried putting its own audio sync group (I tried using those to make things work since I thought I could at the very least resume all songs in each sync group afterwards, but it ended up doing nothing so I backtracked)