How do I make sound run on ios without touch involved

Get help using Construct 2

Post » Tue Mar 31, 2015 2:27 pm

i am running my game with intro animation + sound - however user need to toch the screen to make sound run.
is there a hack around it so sounds will play as soon as layout starts ?
B
8
S
2
Posts: 130
Reputation: 970

Post » Tue Mar 31, 2015 2:40 pm

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 Mar 31, 2015 2:53 pm

Yes i read it. I wonder if there is a hack to make it happen. An event to imitaate touch. Anything goes. Other wise lts of things do not work.

In addition i have an animation with sound that runs only when i touch the sprite. This is akward. On android it works fine
B
8
S
2
Posts: 130
Reputation: 970

Post » Tue Mar 31, 2015 3:07 pm

Working within limitations brings out our creative side..
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 Mar 31, 2015 3:18 pm

Ok. I wonder if other users having a viable solution. Thank you
B
8
S
2
Posts: 130
Reputation: 970

Post » Wed Apr 01, 2015 10:00 am

Hi, just FYI. problem was solved when i moved the files from the music folder to the sound folder. then you dont need a touch to run the sound
B
8
S
2
Posts: 130
Reputation: 970

Post » Wed May 17, 2017 4:18 pm

I had the same issue! Driving me crazy and couldn't find a solution.

Problem was sound wasn't playing on mobile browsers no matter what.. But it did played on desktop browsers.

Moving the sounds to the music folder solved the issue....

Maybe something to look into the future.
B
7
S
3
G
1
Posts: 2
Reputation: 1,260

Post » Thu May 18, 2017 2:42 pm

As LittleStain said, its a limitation and its also helpful in 'some' situations
B
12
S
4
Posts: 32
Reputation: 1,033


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 59 guests