avaneev / r8brain-free-src

High-quality pro audio resampler / sample rate conversion C++ library. Very fast, for both audio resampling and time-series interpolation.
MIT License
570 stars 61 forks source link

Varispeed support #25

Closed johnwbyrd closed 1 year ago

johnwbyrd commented 1 year ago

Thanks for your awesome library. I've used it on a previous project and it has worked very well.

I was wondering if I could get your advice on adding varispeed support to your library. The library seems to assume that the resampling ratio is fixed during stream conversion.

I've already implemented a varispeed SRC using Julius O Smith's sinc table algorithm, but as you would guess, the real-time performance is not acceptable.

It might make the question easier if I limit the scope of the problem to output/input ratios near 1.0.

Again, thanks for your contribution to open source.

avaneev commented 1 year ago

The only practical and fast way to implement "varispeed" is to use cross-fades. Please check this out: #17 You may now use the fast getInLenBeforeOutPos() or getInputRequiredForOutput() functions.