Finish making gender optional.

pull/26/head
Nolan Darilek 6 months ago
parent 9bd767629a
commit 822f770ab8
  1. 1
      Cargo.toml
  2. 4
      src/backends/speech_dispatcher.rs
  3. 6
      src/backends/web.rs
  4. 2
      src/backends/winrt.rs

@ -13,7 +13,6 @@ crate-type = ["lib", "cdylib", "staticlib"]
[features]
speech_dispatcher_0_10 = ["speech-dispatcher/0_10"]
default = ["speech_dispatcher_0_10"]
[dependencies]
dyn-clonable = "0.9"

@ -6,7 +6,7 @@ use log::{info, trace};
use speech_dispatcher::*;
use unic_langid::LanguageIdentifier;
use crate::{Backend, BackendId, Error, Features, Gender, UtteranceId, Voice, CALLBACKS};
use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS};
#[derive(Clone, Debug)]
pub(crate) struct SpeechDispatcher(Connection);
@ -191,7 +191,7 @@ impl Backend for SpeechDispatcher {
.map(|v| Voice {
id: v.name.clone(),
name: v.name.clone(),
gender: Gender::Unspecified,
gender: None,
language: LanguageIdentifier::from_str(&v.language).unwrap(),
})
.collect::<Vec<Voice>>();

@ -11,9 +11,7 @@ use web_sys::{
SpeechSynthesisUtterance, SpeechSynthesisVoice,
};
use crate::Gender;
use crate::Voice;
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};
use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS};
#[derive(Clone, Debug)]
pub struct Web {
@ -270,7 +268,7 @@ impl From<SpeechSynthesisVoice> for Voice {
Voice {
id: other.voice_uri(),
name: other.name(),
gender: Gender::Unspecified,
gender: None,
language,
}
}

@ -354,7 +354,7 @@ impl TryInto<Voice> for VoiceInformation {
Ok(Voice {
id: self.Id()?.try_into()?,
name: self.DisplayName()?.try_into()?,
gender,
gender: Some(gender),
language,
})
}

Loading…
Cancel
Save