I understand there needs to be some user interaction before audio will play on iOS devices. My game has a simple ‘start’ scene with a ‘play’ button - the user must press the button to go to a ‘menu’ scene where background music should be playing.
In a web browser and on iPad this works as expected - pressing the ‘Play’ button on the start scene plays a sound, waits 2 seconds and switches to the Menu scene where the background music starts playing etc.
On iPhone, there is no sound at all in the start or menu scene - music or sound effects - until the user has interacted with the menu scene and moved onto the next scene. If the user then returns to the menu, the sounds and music play as expected.
Apologies if this has been covered elsewhere but I have search extensively. I am using aac files for music and wav for sound effects. Each scene has ‘Stop music and sounds on startup checked’, but this doesn’t seem to make a difference.
Any help gratefully appreciated
Try converting your audio file from wav to aac
Thanks, worth a try but this didn’t help. The music was already in aac anyway and the GDevelop documentation says to use aac for music / wav for effects.
I din’t know this originally, and I was using MP3s for everything, which again worked fine in a browser on PC but caused different issues on mobile devices.
Well as far as i see audio problems on discord it is always problem with unsupported format for some platform
Where aac is always solution because it is most supported format next to ogg
But i rarely see ios problems so i assumed solution would be the same
As for documentation
IDK how old it is but as far as i see it aac for everything
And play sound action for playing sound
While play sound ON CHANNEL action for playing music
That always worked for me and others
But again IDK how well it goes with ios devices
From a quick search on google, iPhone doesn’t support either wav or ogg. You most likely will have to use only aac.
OK,will try this again. I mainly wanted to check I wasn’t doing something obviously wrong - most people seem to use a first scene to capture a user interaction before moving on to the main part of the game?