mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-17 11:29:37 +00:00
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)
|
||||
}
|
||||
|
||||
fn voice(&self) -> Result<Voice, Error> {
|
||||
fn voice(&self) -> Result<Option<Voice>, Error> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
|
|
|
@ -301,9 +301,10 @@ impl Backend for WinRt {
|
|||
Ok(!utterances.is_empty())
|
||||
}
|
||||
|
||||
fn voice(&self) -> Result<Voice, Error> {
|
||||
fn voice(&self) -> Result<Option<Voice>, Error> {
|
||||
let voice = self.synth.Voice()?;
|
||||
voice.try_into()
|
||||
let voice = voice.try_into()?;
|
||||
Ok(Some(voice))
|
||||
}
|
||||
|
||||
fn voices(&self) -> Result<Vec<Voice>, Error> {
|
||||
|
|
Loading…
Reference in New Issue
Block a user