Does it fail even with the second section of code I posted above?
Perhaps you could strip your code down to a bare minimum that still exhibits the problem and that you can post up here? Then we can run it and see what's wrong.
It may not even be related to playback - it might be the rest of your code that's allocating memory somewhere.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Does it fail even with the second section of code I posted above?
Perhaps you could strip your code down to a bare minimum that still exhibits the problem and that you can post up here? Then we can run it and see what's wrong.
It may not even be related to playback - it might be the rest of your code that's allocating memory somewhere.