How do I Play audio on IPad

Get help using Construct 2

Post » Mon Nov 16, 2015 3:41 pm

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
B
5
S
1
Posts: 37
Reputation: 463

Post » Mon Nov 16, 2015 3:49 pm

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 17, 2015 9:39 am

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?
B
5
S
1
Posts: 37
Reputation: 463

Post » Tue Nov 17, 2015 10:28 am

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.)
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
293
S
117
G
96
Posts: 7,310
Reputation: 71,069

Post » Tue Nov 17, 2015 11:44 am

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.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Tue Nov 17, 2015 1:28 pm

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?
B
5
S
1
Posts: 37
Reputation: 463


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests