You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

7 years ago
extern crate speech_dispatcher;
use speech_dispatcher::*;
use std::io;
7 years ago
fn main() {
let connection = speech_dispatcher::Connection::open(
"hello_world",
"hello_world",
"hello_world",
Mode::Threaded,
);
connection.on_begin(Some(|id| println!("Beginning {}", id)));
connection.on_end(Some(|id| println!("Ending {}", id)));
connection.say(
Priority::Important,
format!("Hello, world at rate {}.", connection.get_voice_rate()),
);
7 years ago
connection.set_voice_rate(100);
connection.say(Priority::Important, "This is faster.");
7 years ago
connection.set_voice_rate(0);
connection.set_spelling(true);
connection.say(Priority::Important, "This is spelled.");
7 years ago
connection.set_spelling(false);
connection.set_punctuation(Punctuation::All);
connection.say(
Priority::Important,
"This statement, unlike others, has punctuation that is spoken!",
);
7 years ago
connection.set_punctuation(Punctuation::None);
let mut _input = String::new();
io::stdin().read_line(&mut _input).unwrap();
7 years ago
}