I just got a new phone (Moto G5 Plus) and there's a really weird (and critical) bug with AGK. PlaySound
inconsistently causes the game to freeze.
I have the following code:
if GetPhysicsCollision(player.id,walls[k].id)
tmv#=abs(player.ospeed-player.speed)
if tmv#>10
tmv#=tmv#/2
if tmv#>100 then tmv#=100
t#=timer()
tmp=PlaySound(sfx.hit) //only play hit sound if going fast enough
print(timer()-t#)
SetSoundInstanceVolume(tmp,tmv#)
endif
endif
Most of the time it prints out less than 0.02 for the time used to call PlaySound, but occasionally it takes about 0.18 which is very noticeable and makes the game basically unplayable. I can't figure out why it does it some frames but not others, but it happens for different SFX files, not just this one. While it's obviously freezing on that particular command, the bug does
not occur on a fresh project that only plays sounds, indicating that the freeze is due to some other feature I'm using.
At this stage, I'm simply gonna detect if the freeze is occurring and disable sound effects when it is