Correct way to start and stop music

Get help using Construct 2

Post » Sun Oct 27, 2013 9:41 pm

Hi,

I think I'm not starting and stopping my music correctly or I am not unloading some other resources I should be.

Here is what is happening: I have 3 levels and each level has a different song I stream. When one level ends I stop playing it (on end of layout) and on start of layout, start playing the next song.

The first two songs work great. When I go to the the 3rd level it does not play the song. If I choose one of the two previously played songs, then it will play. If I stop previewing and restart on the 3rd level then the song plays.

I tried making an example game to demonstrate the problem but all the songs play fine in it. My real game that I am debugging has many events, sprites, sounds, and stuff. It feels like my problem is some kind of resource issue.

I'm going to keep working on making an example game that has the issue but I was wondering if anyone had some ideas for me to try in the meantime?

Thank you so much,
Ruth
B
10
S
4
G
1
Posts: 10
Reputation: 997

Post » Mon Oct 28, 2013 7:58 am

My audio performance in relation to busy games events improved when I started preloading the audio at the beginning of the game. Though, it makes the start up a bit slower.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Mon Oct 28, 2013 11:29 pm

lennaert,

Thank you for the reply. I read many articles that said to not preload music because it is streamed. I'm having a problem with music not with sounds. I appreciate your response. Thank you.

I did find something interesting. I found the following post that is the same issue I am having!

http://www.scirra.com/forum/audio-wont-play-on-new-layout_topic58965.html

He found that by exporting as an HTML 5 website then he did not experience the problem. I exported and put on DropBox and poof! no more music problem. So it seems that something is amiss with the Preview engine. I'm going to try to make a demo app that demonstrates the problem. I need to find some time.
B
10
S
4
G
1
Posts: 10
Reputation: 997


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests