use std::time::Duration;
use sapi_lite::tts::{SpeechBuilder, SyncSynthesizer, VoiceGender, VoiceSelector};
fn main() {
sapi_lite::initialize().unwrap();
let speech = SpeechBuilder::new()
.select_and_start_voice(
Some(VoiceSelector::new().gender_eq(VoiceGender::Female)),
None,
)
.start_rate(4)
.say("The pellet with the poison's in the vessel with the pestle.")
.select_and_start_voice(
Some(VoiceSelector::new().gender_eq(VoiceGender::Male)),
None,
)
.say("And the chalice from the palace has the brew that is true.")
.end_voice()
.end_rate()
.start_volume(50)
.silence(Duration::from_millis(500))
.say("Just remember that!")
.end_volume()
.end_voice()
.build();
let synth = SyncSynthesizer::new().unwrap();
synth.set_rate(-2).unwrap();
synth.speak(&speech, None).unwrap();
synth.set_rate(0).unwrap();
synth.set_volume(80).unwrap();
synth.speak(&speech, None).unwrap();
sapi_lite::finalize();
}