mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-17 13:09:37 +00:00
Update example for new API.
This commit is contained in:
parent
c627583928
commit
a0945d7ebb
|
@ -81,11 +81,13 @@ fn main() -> Result<(), Error> {
|
|||
let Features { get_voice, .. } = tts.supported_features();
|
||||
if get_voice {
|
||||
let original_voice = tts.voice()?;
|
||||
for v in &voices {
|
||||
tts.set_voice(v)?;
|
||||
tts.speak(format!("This is {}.", v.name), false)?;
|
||||
if let Some(original_voice) = original_voice {
|
||||
for v in &voices {
|
||||
tts.set_voice(v)?;
|
||||
tts.speak(format!("This is {}.", v.name()), false)?;
|
||||
}
|
||||
tts.set_voice(&original_voice)?;
|
||||
}
|
||||
tts.set_voice(&original_voice)?;
|
||||
}
|
||||
}
|
||||
tts.speak("Goodbye.", false)?;
|
||||
|
|
Loading…
Reference in New Issue
Block a user