I am working on a game that has game play music and also background music that plays on game over. i.e., when the level ends, the game play music pauses and the background music resumes. Conversely, when they start play again, game play music resumes and background music pauses.
The code toggles back and forth using audio.pause and resume on the respective channels. However, I want to restart the game music from the beginning every time, so I preface audio.resume() with audio.seek(0, {channel=gameMusicChannel}) when resuming the game music.
That works, kind of, but I still hear a fraction of a second of the game music from where it left off at the last pause, before it seeks back to 0 and starts again from the beginning.
Is that buffered music from before audio.pause()? If so, how to avoid/clear this?