Stop Music from Stalling Audio?

0 favourites
  • 4 posts
From the Asset Store
6 looping tracks to use in your games and projects. These tracks are in the style of the 1960s detective movie genre.
  • I've noticed that when I start a music loop, it takes about a second for the music to begin playing (when it should begin immediately, like it does in the raw sound file). During that second, all other sounds (short sound effects that worked prior to the longer track starting) don't make any sound, as if they're muted.

    Any idea what's up and how to fix it?

  • Yep. Set up an event On Start Of Layout > Preload Sound. This downloads the sound in advance so it plays immediately when you run the Play Sound event.

  • Thanks! So what time is it recommended that songs are loaded, particularly if there are multiple songs, including ones that don't come until later in the game?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The recommended time is at the start of layout/ upon layout loading. The only problem that can really arise is if you are preloading lots of audio at the same time as this can slow down browsers, so the recommendation is no more than 2 or 3 audio objects being preloaded at once.

    If you find that the preload is still causing a delay, this is because you are preloading a large file. It is best to keep music in the music folder so that it is streamed and have sounds in the sounds folder, which are downloaded before being played. Preload doesn't apply to objects in the music folder.

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