mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-17 11:29:37 +00:00
Remove unspecified gender in favor of Option
.
This commit is contained in:
parent
2b4251f6fa
commit
9bd767629a
|
@ -298,9 +298,9 @@ impl Backend for AvFoundation {
|
|||
let name: CFString = unsafe { msg_send![*v as *const Object, name] };
|
||||
let gender: i64 = unsafe { msg_send![*v as *const Object, gender] };
|
||||
let gender = match gender {
|
||||
0 => Gender::Male,
|
||||
1 => Gender::Female,
|
||||
_ => Gender::Unspecified,
|
||||
0 => Some(Gender::Male),
|
||||
1 => Some(Gender::Female),
|
||||
_ => None,
|
||||
};
|
||||
let language: CFString = unsafe { msg_send![*v as *const Object, language] };
|
||||
let language = language.to_string();
|
||||
|
|
|
@ -704,7 +704,6 @@ impl Drop for Tts {
|
|||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Gender {
|
||||
Unspecified,
|
||||
Male,
|
||||
Female,
|
||||
}
|
||||
|
@ -713,7 +712,7 @@ pub enum Gender {
|
|||
pub struct Voice {
|
||||
pub(crate) id: String,
|
||||
pub(crate) name: String,
|
||||
pub(crate) gender: Gender,
|
||||
pub(crate) gender: Option<Gender>,
|
||||
pub(crate) language: LanguageIdentifier,
|
||||
}
|
||||
|
||||
|
@ -726,7 +725,7 @@ impl Voice {
|
|||
self.name.clone()
|
||||
}
|
||||
|
||||
pub fn gender(&self) -> Gender {
|
||||
pub fn gender(&self) -> Option<Gender> {
|
||||
self.gender
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user