#text-to-speech #tts #gtts

bin+lib tts_rust

Simple & easy text-to-speech module for your needs

10 releases

0.3.5 Dec 9, 2022
0.3.3 Dec 2, 2021
0.3.1 Nov 30, 2021
0.2.0 Aug 13, 2021
0.1.4 Aug 13, 2021

#461 in Audio

Download history 36/week @ 2024-07-20 36/week @ 2024-07-27 38/week @ 2024-08-03 24/week @ 2024-08-10 21/week @ 2024-08-17 10/week @ 2024-08-24 26/week @ 2024-08-31 29/week @ 2024-09-07 29/week @ 2024-09-14 139/week @ 2024-09-21 89/week @ 2024-09-28 46/week @ 2024-10-05 49/week @ 2024-10-12 56/week @ 2024-10-19 39/week @ 2024-10-26 35/week @ 2024-11-02

180 downloads per month
Used in bot-handler-manager

MIT license

16KB
366 lines

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

Dependencies

~6–18MB
~237K SLoC