From b9aa36cb3be01e97cdcc8a4de4751e341bf8d38b Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 31 Mar 2022 10:43:07 -0500 Subject: [PATCH] Update APIs to support case where getting a voice is supported but the value isn't set. --- src/backends/speech_dispatcher.rs | 2 +- src/backends/winrt.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backends/speech_dispatcher.rs b/src/backends/speech_dispatcher.rs index 1da28d9..12ea534 100644 --- a/src/backends/speech_dispatcher.rs +++ b/src/backends/speech_dispatcher.rs @@ -198,7 +198,7 @@ impl Backend for SpeechDispatcher { Ok(rv) } - fn voice(&self) -> Result { + fn voice(&self) -> Result, Error> { unimplemented!() } diff --git a/src/backends/winrt.rs b/src/backends/winrt.rs index 22b992e..97bd130 100644 --- a/src/backends/winrt.rs +++ b/src/backends/winrt.rs @@ -301,9 +301,10 @@ impl Backend for WinRt { Ok(!utterances.is_empty()) } - fn voice(&self) -> Result { + fn voice(&self) -> Result, Error> { let voice = self.synth.Voice()?; - voice.try_into() + let voice = voice.try_into()?; + Ok(Some(voice)) } fn voices(&self) -> Result, Error> {