FilePlayer get removed from channel after pause

After calling fileplayer->pause, the FilePlayer get removed from the channel it was previously added to.

SoundChannel *channel = playdate->sound->channel->newChannel();

FilePlayer *filePlayer = playdate->sound->fileplayer->newPlayer();
playdate->sound->fileplayer->loadIntoPlayer(filePlayer, "sound");
playdate->sound->channel->addSource(channel, (SoundSource*)filePlayer);
playdate->sound->fileplayer->play(filePlayer, 0);
int result = playdate->sound->channel->removeSource(channel, (SoundSource*)filePlayer);
playdate->system->logToConsole((result == 1) ? "source removed" : "source not found");

Workaround: I simply add the player again to the channel before playing it.


Thanks for pointing this out; we will investigate!

1 Like