Audio Not Playing on Correct Layout

Get help using Construct 2

Post » Fri Dec 04, 2015 3:02 am

I am working on a game where on the Main Menu layout a BG Music is supposed to start playing. When I am in Construct 2 it starts fine, but when I export as Cordova and pull into Intel XDK the music does not start until I go to the next layout(by tapping the screen). The the music starts and plays fine. I have tried preloading the music in a layout prior to the Main Menu but it did not help.

All other audio plays correctly.

I also have another game that has BG that starts correct on the Main Menu after being opened in Intel XDK.

Any idea...fyi..i am new :)
B
6
S
1
Posts: 88
Reputation: 613

Post » Sat Dec 05, 2015 2:44 pm

no one?
B
6
S
1
Posts: 88
Reputation: 613

Post » Sat Dec 05, 2015 2:46 pm

Did you check the manual?

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 » Sun Dec 06, 2015 11:23 pm

Thanks for the info. No I did not read the manual. I thought it was a bug, not a limitation since another game I made works perfectly fine and I am pretty sure it is implemented the same way.
Thanks,
Rich
B
6
S
1
Posts: 88
Reputation: 613

Post » Fri Dec 11, 2015 12:00 am

I did find a work-around. I load the BG as a sound instead of music. That starts as expected.
B
6
S
1
Posts: 88
Reputation: 613

Post » Fri Dec 11, 2015 12:54 am

rtkiii wrote:I did find a work-around. I load the BG as a sound instead of music. That starts as expected.


Thank you so much i had the same problem and now it s fixed.
B
4
Posts: 7
Reputation: 214


Return to How do I....?

Who is online

Users browsing this forum: AwesomePlayer, vGoliath and 2 guests