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);
playdate->sound->fileplayer->pause(filePlayer);
  
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

Thanks for pointing this out; we will investigate!

1 Like