I think I’m also seeing incorrect lengths with sampleplayer – playdate.sound.sampleplayer:getLength() reports slightly more than double the actual length after using playdate.sound.sampleplayer.new(path) to load from a few different ADPCM wav files (encoded using the ffmpeg command in the docs), although I haven’t investigated it very thoroughly. Could that be the same underlying issue as well, or something different?
I haven’t tried getOffset, but playdate.sound.sampleplayer:setOffset() also requires doubling the value to get it to seek close to the right place.
sampleplayer:setOffset() seems to be completely broken now (as of 1.12.0).
I’m using sampleplayer:setOffset(seconds) followed by sampleplayer:play(1) and it starts at the wrong place in the sample (too early) and doesn’t finish playing before it stops.
In 1.11, I was able to work around the issue by simply halving all the values I got from sampleplayer:getLength and doubling all the values I passed to sampleplayer:setOffset. In 1.12.0, I can’t find any workaround: sampleplayer:getLength now returns the correct value, but sampleplayer:setOffset seeks to the wrong place. I attempted to work around this by adding a multiplier to the value I pass to sampleplayer:setOffset to correct for the wrong start time, which sort of works but crashes the simulator when the sample finishes playing (crash output here). Trying this on device results in a freeze followed by the “Sorry, your Playdate needs to restart” screen without the option to press B for the crash log. The file in question is a stereo ADPCM .wav.