Update APIs to support case where getting a voice is supported but the value isn't set.

pull/26/head
Nolan Darilek 8 months ago
parent e699f7e5e5
commit b9aa36cb3b
  1. 2
      src/backends/speech_dispatcher.rs
  2. 5
      src/backends/winrt.rs

@ -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…
Cancel
Save