Hi @Appvism,
I’d probably condense it into one local function, but that’s just me.
Brent
Your method should work. When I’ve done something like that in the past, I’ve looped the same song for the level and I change songs when the level changes.
One thing I might recommend is it sounds like your audio is not tied to the scene itself. If it’s not scene dependent then I would load the sounds in main.lua and have that code in main.lua so it’s not tied to scenes.
Cheers guys. Actually, i usually just loop a single track for each level but in this case the level is potentially endless (though practically unlikely), hence the need for me to not use a single looping track and at the same time, have the tracks repeat themselves as a sort of playlist.
By the way, i tried adding a slight delay as well before playing the next track but that didn’t work for me. Think i’ll have a rethink about this - perhaps not tie it to the scene or split into mini levels…
Thanks,
I had the exact same problem and using audio.stop(channel) got rid of the error message.
I had the exact same problem and using audio.stop(channel) got rid of the error message.
I’ve been having the same problem, and for me, it was because in a previous scene I was accidentally calling scene:exitScene twice (due to not cancelling a timer, whose listener function was calling it scene:exitScene after it had already been called), which was triggering audio.stop() and audio.reserveChannels() twice. I’m not sure exactly why, but in the next scene, I’d eventually get the same error you were reporting above.
I’ve been having the same problem, and for me, it was because in a previous scene I was accidentally calling scene:exitScene twice (due to not cancelling a timer, whose listener function was calling it scene:exitScene after it had already been called), which was triggering audio.stop() and audio.reserveChannels() twice. I’m not sure exactly why, but in the next scene, I’d eventually get the same error you were reporting above.