Crackling sound setting volume

Hi all, I have an issue with a sound, I play the sound endlessly (repeat = 0)

SamplePlayer *player = playdate->sound->sampleplayer->newPlayer();
AudioSample *sample = playdate->sound->sample->load("sounds/curb");
playdate->sound->sampleplayer->setSample(player, sample);

playdate->sound->sampleplayer->play(player, 0, 1);

When I call setVolume in the update callback

playdate->sound->sampleplayer->setVolume(player, 0, 0);

I hear a crackling / click sound passing from 0 volume to another value (and vice versa).

Here's the audio file: (5.2 KB)


I had the same issue with popping when setting the volume or starting/stopping a sample. The only way I was able to fix it is by fading it in over time using delta time.

1 Like

A fast fading mitigate the issue, thanks for the reply!