Crates.io | fliters |
lib.rs | fliters |
version | 0.1.7 |
source | src |
created_at | 2024-01-22 01:05:59.172359 |
updated_at | 2024-03-25 14:46:07.860814 |
description | basic rust bindings for flite c library |
homepage | |
repository | |
max_upload_size | |
id | 1108144 |
size | 17,969,401 |
rust bindings for the flite c library
Check out /examples
directory for more examples.
// standard example
use fliters;
fn main() {
fliters::tts("hello, world!").play();
}
// Controlling the output stream. (i.e. playing and pausing)
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();
}
I've only tested on MacOS Sonoma 14.2. xD
play
Add this to your cargo.toml:
fliters = "0.1.7"
If you install the crate, but encounter build errors (especially linker errors), try to specify the repo as the dependency. Submit an issue in the meantime so I can investigate.
fliters = { git = "https://github.com/jackycamp/flite-rs" }
# clone the repository
git clone https://github.com/jackycamp/flite-rs.git
# do the build
cd flite-rs && cargo build
# run an example
cargo run --example tts