Music takes time to play

The music takes time to play. I use an .mp3 file for the ambient music of the menu and another .mp3 file for the game. The events are:

At the beginning of the scene ------- play sound, loop: yes

I don’t use the music event because you have to touch the screen before, so I use the sound event.

Could you help me?

Currently GDevelop does not preload audio, so you have to play the sound at the beginning of the game for at least a few seconds to preload it manually.

I have requested this feature here:

Let the developers know you support this idea :+1:

Maybe it can be fixed by preloading the audio through Javascript code. Could you help me with this? The bad sound makes my game unprofessional.

The way I’m thinking about addressing this in the game I’m making is to do a fade-in (black box covering the entire screen, increasing it’s transparency using a TimeDelta() expression until it’s invisible. Potentially a very fast one.

I’ll then play all of the music and sounds for my level at 0 volume to load them into memory, and start the music over at normal volume once the transparency is 0. That should reduce or eliminate the perceived delay, maybe?

1 Like