tts_rust

Crates.iotts_rust
lib.rstts_rust
version0.3.5
sourcesrc
created_at2021-08-12 09:35:56.455064
updated_at2022-12-09 13:37:21.232285
descriptionSimple & easy text-to-speech module for your needs.
homepage
repositoryhttps://github.com/dhairy-online/tts_rust
max_upload_size
id435171
size54,093
Nightly (dhairy-online)

documentation

README

tts_rust

Really Simple Text to Speech module for rust

Cargo.toml

Add this to your Cargo.toml file:

tts_rust = "0.3.4"

Uses cargo fmt as formatter

use cargo update to update to version 0.3.3

Example...

use tts_rust::{ GTTSClient, languages::Languages };

fn main() {
    let mut narrator: GTTSClient = GTTSClient {
        volume: 1.0, 
        language: Languages::English, // use the Languages enum
    };
    narrator.speak("Hello, World!");
}

...Or a more advanced one

use tts_rust::{ GTTSClient, languages::Languages };

fn main() {
    let mut narrator: GTTSClient = GTTSClient {
        volume: 1.0,
        language: Languages::English,
    };
    narrator.speak("Starting test?");
    let ms = std::time::Duration::from_millis(1000);
    for _x in 1..9 {
        narrator.volume += 1.0;
        let to_speak: String = String::from("Loop ") + &narrator.volume.to_string();
        narrator.speak(&to_speak);
        std::thread::sleep(ms);
    }
}

License

MIT

Commit count: 45

cargo fmt