use fliters; use rodio::{OutputStream, Sink}; fn main() { let (_stream, handle) = OutputStream::try_default().unwrap(); let sink = Sink::try_new(&handle).unwrap(); let fwav = fliters::tts("play this audio with some stream controls"); let decoder = fwav.get_decoder(); sink.append(decoder); sink.play(); std::thread::sleep(std::time::Duration::from_secs(1)); sink.pause(); std::thread::sleep(std::time::Duration::from_secs(3)); sink.play(); sink.sleep_until_end(); }