How do I Play audio on IPad

0 favourites
  • 6 posts
From the Asset Store
This Student Workbook uses both Construct 3 & 2 encoding. It supplies client-side & php "back-end" encoding.
  • So I have this game where my audio plays very well on my computer, however when I play it on my IPad the music does not play. I know this is not a fault with my iPad as I have played other games on my iPad where the music plays fine. I am using an .ogg file.

    Thanks in advance

  • I'm sure you have already checked the manual, but for anyone with a similar question finding this thread I'll add this:

    (From the manual on the audio object)

    Mobile limitations

    Safari on iOS and Chrome for Android share a limitation in playing music. While sound effects can be played at any time, music is only allowed to start playing when the user touches the screen. This is a limitation in the browsers themselves. As a result, if you play music on the start of layout, you may find in these browsers it does not actually start until the next touch.

    Safari on iOS has a further limitation that no audio can play at all until the first touch. In other words, audio starts off muted and the first touch unmutes audio playback.

    Usually you do not need to handle this in your events. If you try to play sound or music on 'start of layout', the audio object will automatically queue it up for playback the next time the user touches the screen. However you should be aware of this when designing your game. If the first touch changes layout or stops the music, then the music may never be heard. You may want to start playback then encourage the user to touch the screen with a 'Play' icon or something similar.

  • Thanks for the response,

    I have read the manual before I posted this topic.

    The way my music is started is by touch:

    On button Pressed Play Music.

    On button Pressed Stop Music.

    Im constantly tapping the screen whilst I'm in my game.

    Are my .OGG files okay for IPad or do I need another type of file?

  • Are you using a recent version enough that circumvents iOS 9 audio issue ?

    I'd believe the preferred format for iOS is m4a. (source old, so perhaps outdated, yet, all I found through google so far tends to confirm Safari still doesn't support ogg.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • iOS can't play ogg files, you need the .m4a equivalents. C2 should encode them for you if you import PCM WAVs like the manual recommends. You should also check you're using the latest version of C2 where we worked around a change in iOS that prevented audio playing.

  • Thanks for replying to me, using m4a files makes sense.

    I converted my files to m4a but when I try to use it In my code it isn't showing....

    Like before I imported my music(m4a this time) into my project bar but when I try and code it into the game it does not appear. All that pops up is my old OGG. file...

    Eg.

    On button click, Play Music. When it asks me what music to use it does not appear...

    Am I doing something wrong?

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