mush42 / sonata

A cross-platform inference engine for neural TTS models.
MIT License
63 stars 14 forks source link

No instructions on how to build and synthesize some text or files #1

Open denizsincar29 opened 1 year ago

denizsincar29 commented 1 year ago

Hello. Can you provide info on how to build and synthesize some text in rust? I have no idea.

mush42 commented 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.

avocadoboi commented 1 year ago

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(())
}
mcmah309 commented 7 months ago

@mush42 Any update on when examples could be added and/or this package being published on crates.io ? Great work by the way!

thewh1teagle commented 1 month ago

@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.