Audio playback time

Hi all!

I am using Cocos Creator version 3.8.3.

Typically I have always used uncompressed audio data to play sounds, more specifically wav files. Now I have been provided with all the sounds in mp3 format.

Let’s take a button click event. I attach mp3 sound playback to this event. I test it on a computer and everything is fine. I test it on a phone and I feel a delay between the click and playback.

How can I eliminate this delay? I think that converting such sounds to wav will allow this, right? Only then will the size of the assembly increase. But I was categorically forbidden to get rid of compression. Maybe the engine has the ability to decompress sounds in advance?

Try looking into preloading:

I don’t understand how this will help me?

By the time I do playOneShot(), the AudioClip has long been loaded via resources.load().

I believe I’ve preloaded to avoid delays in the past. MP3 doesn’t get uncompressed. It’s compressed but can’t be taken back into a lossless file type like wav. Wav should take longer to load being a lot bigger in filesize compared to MP3 but like I said, I have a feeling preloading might solve your issue.