Hey!
I have a looping sample I want to play when the crank's turned. I load the sample, set it playing with play(0), then immediately set it to paused with setPaused(true). But it plays anyway! If I then on a later frame set it to unpaused and then paused again, it pauses as expected.
Am I doing something wrong or is this a bug?
Am using 1.12.3 on mac and windows, but only tested on mac simulator so far.
Hmm, on top of this, sampleplayer:isPlaying() reports false both when it is stopped and when it is paused, so I can't tell the difference. I can keep track of it myself with a boolean outside the class, but perhaps there should be distinction in the class itself - maybe an isPaused() function or a getPlayState() function?
Can you share your code? I feel like this might come from where you call these functions.
Well it was in a state initialisation which was called from playdate.update().
looked along the lines of
sp = {}
...
sp = playdate.sound.sampleplayer.new("path/to/my/file")
sp:play(0)
sp:setPaused(true)
This doesn't result in the sound being paused.