Playing sounds in loop causes crackles

Playing sounds in loop causes crackles


Current audio engine doesn’t support speed changing of playing sounds. My workaround is to use pre-generated sounds with different speeds and play them when needed.

This is what i do in general:

  1. Play in loop sound1.
  2. Stop sound1, play in loop sound2.

Unfortunately, playing sounds in loops causes “crackles/pops”. Additionally, when I stop current sound and play another one I hear same crackles.

Any idea? I see that this is a known issue also in other engines, but I can’t find the solution. I have already tried to set the sounds start/end to 0 in audio editor.

I am using new AudioEngine and cocos v3.15.



on what platform are you testing on?

Can you send me a small demo project with your sounds so I can try testing what you are actually using?


I am testing on Android and windows. On windows it works well.

These “crackles” are mostly noticeable when I change sounds very fast - in my game I change speed of the plane and based on the speed I play the proper sounds.

No test project, but I could send you sound files. It happens with ogg and wav files.

I was able to change the sound files a little bit and now loops work well. Crackles still occur when I change the sound. I guess it happens when currently playing sound is being stopped (or the new sound is starting).

I tried to turn off the loop and set the volume to 0.0f instead of calling stop on the currently playing sound, but with no luck.