Open denizsincar29 opened 1 year ago
Hi @denizsincar29
I'm planning to add a binary crate to serve as a frontend to the crate as well as to showcase some of the capabilities of this synthesizer.
Here's a simple example I made in my fork.
use std::{
sync::Arc,
error::Error
};
use once_cell::sync::Lazy;
use piper::{
synth::PiperSpeechSynthesizer,
vits::VitsModel
};
static ENVIRONMENT: Lazy<Arc<ort::Environment>> = Lazy::new(|| Arc::new(ort::Environment::default()));
fn main() -> Result<(), Box<dyn Error>> {
let synthesizer = PiperSpeechSynthesizer::new(Arc::new(VitsModel::new("en_GB-alba-medium.onnx.json".into(), "en_GB-alba-medium.onnx".into(), &ENVIRONMENT)?))?;
synthesizer.synthesize_to_file("hello.wav", "Hello world".to_string())?;
Ok(())
}
@mush42 Any update on when examples could be added and/or this package being published on crates.io ? Great work by the way!
@mcmah309
I added pr with simple example
@mush42 Would you mind publish the crates to crates.io so we can use that example in other projects? I can't publish another project that depends on unpunished crate.
Hello. Can you provide info on how to build and synthesize some text in rust? I have no idea.