github.com/newdigate/teensy-variable-playback
I started this endeavour a few years back, I needed samples played at variable playback rate.
The initial implementation was a hack but it worked okay for non-interpolated resampling, a little buggy with linear interpolation - especially in reverse. (Sounds awful without interpolation, almost like 8-bit.. linear interpolation is slightly better)
There was a lot of interest in this code and I finally had a chance to iron out the wrinkles and implement quadratic interpolation. 300 commits later and it sounds much better and its stable.
It can play from array or from uSD card file (raw or wav)
I've made it available from the Arduino library manager, just search TeensyVariablePlayback - and have a look at the examples.
I'm going to look at implementing stereo, when I get a chance next.
I've tested on teensy 4.1 and teensy 3.6
Please feel free to use, develop, improve. I would be interested to know what you think.
Cheers
Nic