Correct way to start and stop music

0 favourites
  • 3 posts
From the Asset Store
Every game developer starts with an idea, and it can come from anything:
  • 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

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

    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.

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