How do I get around mobile audio limitations?

0 favourites
  • 9 posts
From the Asset Store
Like tourists, Travel around the world as fast as you can!
  • Hi guys, OK, so I've started work on trying to make an iPad game, I've read the manual and I understand that mobile browsers have some pretty major limitations in regards to audio, whenever you start a new layout "audio starts off muted and the first touch unmutes audio playback". So , is there a way I can get around this?

    The manual gives the example of "start playback then encourage the user to touch the screen with a 'Play' icon or something similar", I mean sure that's a fine solution if you're just making a game with one layout, but in the game I'm designing you're constantly moving to new layouts, so I can't expect the player to have to press 'play' every time they enter a new room.

    I'm just wondering if there's a way to event around this problem, or is there any other solutions I'm not thinking of?

    Any help would be very much appreciated, cheers

  • Hmm, which manual entry are you looking at? The engine now handles this automatically. In Safari audio will be muted until the first touch because that's a limitation Safari imposes, but you don't need any events to handle this. Also it doesn't reset every layout, it's only once when the project first starts.

  • Hi Ashley, I read this part of the manual https://www.scirra.com/manual/109/audio under "Mobile limitations".

    I'm still very new and I'm a bit confused, I've only tested over wifi so far and every time i switch layouts there is no sound until I touch the screen, maybe this isn't an issue if the game is properly exported but I'm not sure?

  • I've been trying all day and I still can't get this to work in the way Ashley says it should, I'm sure it's something I'm doing wrong but I just can't figure it out, I've uploaded a very simple .capx which shows my problem, when previewing on my iPad over wifi the music stops every time you move to a new layout, it will not start unless you touch the screen on every different layout you go to. I would really be grateful if anyone has the time to check out the capx and tell me if I'm making some kind of n00bish blunder, massive thanks in advance to anyone who can help.

    https://mega.nz/#!l0UX1KiA!F5JG5MqApVoA ... whrbLGfMCc

    Edit: I just tested this on an Android tablet (Nexus 9) over wifi and I get the same result, no music on layouts unless you touch the screen first (not just the first layout, but all of them)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can basically ignore the limitation and the C2 engine will queue the audio to play on the next touch. Music only starting when you next touch the screen is a limitation in Chrome for Android and Safari on iOS.

  • You can basically ignore the limitation and the C2 engine will queue the audio to play on the next touch. Music only starting when you next touch the screen is a limitation in Chrome for Android and Safari on iOS.

    Ashley, but it seems that in iOS9, with the touchstart/touchend issue, we can get a situation when the game requires a touch and hold gameplay("is in touch" action), the music will never be triggered, because the first touch never happened, because C2 does not interpret "is in touch" as a "touch start", to trigger the music, or am I wrong.

    I don't have iOS 9, but this was reported to me about one of my games.

    This is easily solved by trigger the music in a different way, but I thought it worth to mention it.Thx

  • There's nothing you can do: you can't make a sound on iOS 9 until a touchend event. It's Apple who impose this restriction, not us. The only solution is to adapt your game design to take this in to account.

  • Gradius

    A common work around when entering a new layout, is to have a dialogue with the level name and some details, with a little "Ok" button below it, required to touch.

  • There's nothing you can do: you can't make a sound on iOS 9 until a touchend event. It's Apple who impose this restriction, not us. The only solution is to adapt your game design to take this in to account.

    OK Ashley thx

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)