mirror of https://github.com/ndarilek/tts-rs.git
Update APIs to support case where getting a voice is supported but the value isn't set.
This commit is contained in:
parent
e699f7e5e5
commit
b9aa36cb3b
|
@ -198,7 +198,7 @@ impl Backend for SpeechDispatcher {
|
||||||
Ok(rv)
|
Ok(rv)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn voice(&self) -> Result<Voice, Error> {
|
fn voice(&self) -> Result<Option<Voice>, Error> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,9 +301,10 @@ impl Backend for WinRt {
|
||||||
Ok(!utterances.is_empty())
|
Ok(!utterances.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn voice(&self) -> Result<Voice, Error> {
|
fn voice(&self) -> Result<Option<Voice>, Error> {
|
||||||
let voice = self.synth.Voice()?;
|
let voice = self.synth.Voice()?;
|
||||||
voice.try_into()
|
let voice = voice.try_into()?;
|
||||||
|
Ok(Some(voice))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn voices(&self) -> Result<Vec<Voice>, Error> {
|
fn voices(&self) -> Result<Vec<Voice>, Error> {
|
||||||
|
|
Loading…
Reference in New Issue