I have something similar in the works, but I'm going the GUI route: https://github.com/robmorgan/halo
Regardless, you might be able to use my timestretch library: https://github.com/robmorgan/timestretch-rs - it's still very early, but it's working for alot of my use cases, and it's pure Rust.