• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Sounds not stopping in Safari on iPhone

markysoft

Member
Hi there, I've made a small demo game but have a problem getting the sounds to stop in Safari on an iPhone.

I have an array of sounds and other things in my game object:

Code:
current_st = 0
soundtracks = [snd_track1, snd_track2, snd_track3, snd_track4, snd_track5, snd_track6]
current_sound = noone
And I change tunes with the following on room start:

GML:
function change_tune() {
    if (current_sound != noone) {
        audio_stop_sound(current_sound)
    }
    audio_stop_all()
    current_sound = audio_play_sound(soundtracks[current_st], 1, true)
    current_st++
    current_st = current_st < array_length(soundtracks) ? current_st : 0
}
I originally just had audio_stop_all, but also tried to use audio_stop_sound but neither stop the sounds in Safari.
It just continues to play each track over the top of the previous so you get a cacophony of multiple tunes all playing at once.

It's fine if I build the game for desktop and in other browsers on my PC and Android phone, but not Safari on an iPhone.

Here's the game on itch.io:


It's retricted until I fix this issue, you'll need the password safari to access the page.

Any advice greatly appreciated!
 

Roldy

Member
I started the game on iPhone safari. Didn't notice anything with the sound. It controls like poop so I didn't play much. Guessing I need to trigger a room change to possibly see/hear the issue? Does hitting 'restart' supposed to demonstrate the problem?

-- Tap controls make [copy paste] bubble come up and gets in the way of the screen

If you want someone to help confirm and troubleshoot, maybe make a simple test app that demonstrates the issue instead of your full game. Will most likely help you fix the issue quicker.
 
Last edited:

markysoft

Member
Thanks for looking, restart should demonstrate the problem. By the way, you can skip levels with 'n'.

Interesting, didn't see the copy paste issue on either mobile I tried, will investigate that too.
 

Roldy

Member
I have an iPhone XR and iOS 14.4.2.

When trying to control, the Copy|Paste pops up like it does if you hold you finger on text for a second.

The controls in general seemed to be off. Pressing left side or right side of screen seemed to make the ship move in random directions.

I hit the restart button a bunch, but honestly didnt hear any thing strange. Would think it would sound delays/echo/layered from what you described
 
Top