Audio Not Working on iPhone Mobile Device

Hi all, I’m sorry for the second post but this is the last component of the game I am working on and I can’t get it right. I have tried multiple different ways but my audio is not working when I view on web from a mobile device.

After looking around, I created a simple start scene with a button that changes the scene in order to have the player interact with the game.

By default, the music plays in the background with the global volume at zero. When the toggle switched is checked, it turns the volume on. This works on desktop but on my iPhone in browser (chrome or safari) there is no audio whatsoever.

While troubleshooting, I created a pre-built game to look at the audio settings and while the pre-built game audio works fine on mobile device, I can’t find any major differences in how I have the audio set up versus how the pre-built game is set up.

Thanks in advance for any help.

This may not be the solution, but try adding a condition to the first Audio event, the condition “VolumeSwitch2 is not checked” - you may need to invert the condition “VolumeSwitch2 is checked” to achieve this.

Can you screen shot this? There may be a difference that you’re not noticing.

The wiki say all.
Check the first note:
https://wiki.gdevelop.io/gdevelop5/all-features/audio/

And as you’re using a music file, you must use the music action instead of the sound action in the Audio group. Because of this red note:
https://wiki.gdevelop.io/gdevelop5/all-features/audio/#choosing-between-sound-or-music-actions

Thanks for the response.

I had the action set to play music. Originally, why I changed it is because the audio would not loop properly. When I changed it to sound, it looped properly.

After trying again, the audio just sounds like a distorted mess.

After switching it back to sound, it plays and loops fine on desktop just not on iPhone.

Additionally, the pop sounds I have set to play as a user taps an object, are for some reason working.

I have a “start scene” that forces the player to click start, confirming the interaction with the game and allowing for audio to be played.

The music action allows for preloading in advance.
But it seems that this isn’t enough, and it’s either not read properly or not at all.
Is the file large and heavy?
Also check the Resources tab, as there are some loading options there that might be useful, I believe.

Thanks again for the response.

I did check the resources tab and realized I hadn’t preloaded it. Unfortunately, it did not fix it. The file shouldn’t be too taxing as it is 339kb.

One thing I noticed is that I had two similarly named files. loop7.mp3 and loop7.aac. I removed the mp3 thinking maybe there was some confusion but that didn’t help.

To add to the frustration, I have another sound that plays at the start of a retry scene. Oddly enough that sound is an mp3 and also plays as it should on the mobile device.

Thank you for the suggestion I tried to invert the condition but still no luck.

I played around more and was able to come up with a working solution.

Level:

External/All Events:

  • my original music (loop) was 7 seconds long.
  • I increased the song to 3 minutes.
  • Instead of relying on global volume, I used channels and a toggle to switch to pause and resume audio.

As of now, all sound is working on mobile device and the game is playing like it should.

Thanks everyone for your help.

I’m switching this topic to bug report given the current problem.