mirror of https://github.com/ndarilek/tts-rs.git
Get example previewing voices even if one can't be gotten.
This commit is contained in:
parent
e3542abd7c
commit
264af78c58
|
@ -79,15 +79,13 @@ fn main() -> Result<(), Error> {
|
||||||
println!("{:?}", v);
|
println!("{:?}", v);
|
||||||
}
|
}
|
||||||
let Features { get_voice, .. } = tts.supported_features();
|
let Features { get_voice, .. } = tts.supported_features();
|
||||||
if get_voice {
|
let original_voice = if get_voice { tts.voice()? } else { None };
|
||||||
let original_voice = tts.voice()?;
|
for v in &voices {
|
||||||
if let Some(original_voice) = original_voice {
|
tts.set_voice(v)?;
|
||||||
for v in &voices {
|
tts.speak(format!("This is {}.", v.name()), false)?;
|
||||||
tts.set_voice(v)?;
|
}
|
||||||
tts.speak(format!("This is {}.", v.name()), false)?;
|
if let Some(original_voice) = original_voice {
|
||||||
}
|
tts.set_voice(&original_voice)?;
|
||||||
tts.set_voice(&original_voice)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tts.speak("Goodbye.", false)?;
|
tts.speak("Goodbye.", false)?;
|
||||||
|
|
Loading…
Reference in New Issue