You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
589 B
19 lines
589 B
use rodio::{OutputStream, Sink};
|
|
use rodio::buffer::SamplesBuffer;
|
|
use fry::tts;
|
|
|
|
fn main() {
|
|
let (_stream, stream_handle) = OutputStream::try_default().unwrap();
|
|
let mut buf: [i16; 665920] = [0; 665920];
|
|
tts("tait", &mut buf);
|
|
let sink = Sink::try_new(&stream_handle).unwrap();
|
|
|
|
// Add a dummy source of the sake of the example.
|
|
let source = SamplesBuffer::new(1, 22050, buf);
|
|
sink.append(source);
|
|
|
|
// The sound plays in a separate thread. This call will block the current thread until the sink
|
|
// has finished playing all its queued sounds.
|
|
sink.sleep_until_end();
|
|
}
|