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.
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.
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.
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.