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
180 downloads per month
Used in bot-handler-manager
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