Sampleplayer silent crash using setRate

Hi,
It looks like calling the setRate function of the sampleplayer can generate a silent crash of the app.
The crash does not happen at the function call, but later, outside of the playdate.update() function.

When we quickly change the rate (from a small negative value to 0), a crash can occur.
This seems to mainly happen using an heavy audio file (like a .caf one, but I also managed to reproduce it with an ADPCM .wav file)

In my app, this code, can reproduce the crash :

if (frame == 10) then music:setRate(0)
elseif (frame == 11) then music:setRate(-0.0001261773)
elseif (frame == 12) then music:setRate(0)
end

A workaround seems to be to set the rate to a small positive first, before setting it to 0 at the next frame.

1 Like

Hi,
Any update on that problem ?
Do you need a sample project to reproduce it ?