calling pd->sound->sampleplayer->play with repeats set to 0 is supposed to play your sample indefinatly until stop() is called called according to the documentation:
however this does not seem to be the case it seems to repeat exactly 64 times each time and then stops repeating i don't know why but i tested with a few audio files both long and small ones it stops always after 64 repeats (which is an odd nr's if you ask me).
I've used the following sound to test this (it's easy to count the times) :
draw.zip (20.3 KB)
and i've used the following example updateloop / program to test it out. In both simulator as on playdate it stops repeating after 64 times
Am i doing something wrong codewise ? or is this a bug ?
SamplePlayer* player = NULL;
AudioSample* Sample = NULL;
// main update function
int update(void* ud)
{
if (player == NULL)
{
player = pd->sound->sampleplayer->newPlayer();
if (player)
{
Sample = pd->sound->sample->load("draw");
if (Sample)
{
pd->sound->sampleplayer->setSample(player, Sample);
pd->sound->sampleplayer->setVolume(player, 1.0f, 1.0f);
pd->sound->sampleplayer->play(player, 0, 1.0f);
}
}
}
return 1;
}
edit this only seems to happen with ADPCM encoded wav files, i rencoded the draw.wav file to pcm 16 bit signed and it does not have the issue