Hello,
I'm using the SDK Version 2.7.2 on my M2 Mac.
Today I've been having trouble with looping a song in my project. It worked fine before I downloaded the new SDK 2.7.2, but now I have noticed that a looped song repeats exactly half way in the song, not at the end of the song like it normally should. I've tried different songs with different lengths and they all have the same problem. I even tried it in a different project and it still happens. Both the simulator and my physical device are both experiencing this problem.
Here's the code:
local song1 = playdate.sound.fileplayer.new()
song1:load("sounds/TestSong")
song1:setVolume(0.5)
song1:play(0)
Yeah okay so I went back to 2.7.1 and deleted the pds files from the pdx, then built again, and this time they came out the right size. Something is wrong with 2.7.2.
Is this a stereo ADPCM file exported from Audacity, by chance? It looks like they've got a bug causing the WAV fact chunk to be half the correct size. In 2.7 we added handling of the fact data so that ADPCM files were the correct size when the encoder used a full block at the end instead of truncating it, but got reports of short files and found this problem. In 2.7.3 I have the compiler doubling that fact value if it looks like it's half the size it should be.
Yes, thank you! And yes, I am using ADPCM files exported from Audacity. And it looks like I'm running a really old version of Audacity which sounds like that could be the cause? I'll update and see if that fixes it.
I had the same issue as well. I could not for the life of me figure out what the issue was, so i re-encoded the music file using a different tool (To Audio Converter) and then it was working for me again on 2.7.2.