mirror of https://github.com/ndarilek/tts-rs.git
Compare commits
No commits in common. "2667d4e943a2dfedd816d3df675108b69b118c2a" and "d65d79f8fb5e1027a59d451aa8e3f0b8d6544bd1" have entirely different histories.
2667d4e943
...
d65d79f8fb
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tts"
|
||||
version = "0.25.0"
|
||||
version = "0.24.3"
|
||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||
repository = "https://github.com/ndarilek/tts-rs"
|
||||
description = "High-level Text-To-Speech (TTS) interface"
|
||||
|
@ -19,18 +19,18 @@ default = ["speech_dispatcher_0_11"]
|
|||
|
||||
[dependencies]
|
||||
dyn-clonable = "0.9"
|
||||
oxilangtag = "0.1"
|
||||
lazy_static = "1"
|
||||
log = "0.4"
|
||||
serde = { version = "1", optional = true, features = ["derive"] }
|
||||
thiserror = "1"
|
||||
unic-langid = "0.9.0"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.10"
|
||||
env_logger = "0.9"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
tolk = { version = "0.5", optional = true }
|
||||
windows = { version = "0.43", features = ["Foundation", "Foundation_Collections", "Media_Core", "Media_Playback", "Media_SpeechSynthesis", "Storage_Streams"] }
|
||||
windows = { version = "0.42", features = ["Foundation", "Foundation_Collections", "Media_Core", "Media_Playback", "Media_SpeechSynthesis", "Storage_Streams"] }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
speech-dispatcher = { version = "0.16", default-features = false }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||
use std::sync::Mutex;
|
||||
use std::{str::FromStr, sync::Mutex};
|
||||
|
||||
use cocoa_foundation::base::{id, nil, NO};
|
||||
use cocoa_foundation::foundation::NSString;
|
||||
|
@ -10,7 +10,7 @@ use lazy_static::lazy_static;
|
|||
use log::{info, trace};
|
||||
use objc::runtime::{Object, Sel};
|
||||
use objc::{class, declare::ClassDecl, msg_send, sel, sel_impl};
|
||||
use oxilangtag::LanguageTag;
|
||||
use unic_langid::LanguageIdentifier;
|
||||
|
||||
use crate::{Backend, BackendId, Error, Features, Gender, UtteranceId, Voice, CALLBACKS};
|
||||
|
||||
|
@ -312,7 +312,7 @@ impl Backend for AvFoundation {
|
|||
CFString::wrap_under_get_rule(msg_send![*v as *const Object, language])
|
||||
};
|
||||
let language = language.to_string();
|
||||
let language = LanguageTag::parse(language).unwrap();
|
||||
let language = LanguageIdentifier::from_str(&language).unwrap();
|
||||
Voice {
|
||||
id: id.to_string(),
|
||||
name: name.to_string(),
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#[cfg(target_os = "linux")]
|
||||
use std::{collections::HashMap, sync::Mutex};
|
||||
use std::{collections::HashMap, str::FromStr, sync::Mutex};
|
||||
|
||||
use lazy_static::*;
|
||||
use log::{info, trace};
|
||||
use oxilangtag::LanguageTag;
|
||||
use speech_dispatcher::*;
|
||||
use unic_langid::LanguageIdentifier;
|
||||
|
||||
use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS};
|
||||
|
||||
|
@ -192,7 +192,7 @@ impl Backend for SpeechDispatcher {
|
|||
id: v.name.clone(),
|
||||
name: v.name.clone(),
|
||||
gender: None,
|
||||
language: LanguageTag::parse(v.language.clone()).unwrap(),
|
||||
language: LanguageIdentifier::from_str(&v.language).unwrap(),
|
||||
})
|
||||
.collect::<Vec<Voice>>();
|
||||
Ok(rv)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#[cfg(target_arch = "wasm32")]
|
||||
use std::sync::Mutex;
|
||||
use std::{str::FromStr, sync::Mutex};
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use log::{info, trace};
|
||||
use oxilangtag::LanguageTag;
|
||||
use unic_langid::LanguageIdentifier;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::{
|
||||
|
@ -264,7 +264,7 @@ impl Drop for Web {
|
|||
|
||||
impl From<SpeechSynthesisVoice> for Voice {
|
||||
fn from(other: SpeechSynthesisVoice) -> Self {
|
||||
let language = LanguageTag::parse(other.lang()).unwrap();
|
||||
let language = LanguageIdentifier::from_str(&other.lang()).unwrap();
|
||||
Voice {
|
||||
id: other.voice_uri(),
|
||||
name: other.name(),
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#[cfg(windows)]
|
||||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
str::FromStr,
|
||||
sync::Mutex,
|
||||
};
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use log::{info, trace};
|
||||
use oxilangtag::LanguageTag;
|
||||
use unic_langid::LanguageIdentifier;
|
||||
use windows::{
|
||||
Foundation::TypedEventHandler,
|
||||
Media::{
|
||||
|
@ -353,7 +354,7 @@ impl TryInto<Voice> for VoiceInformation {
|
|||
Gender::Female
|
||||
};
|
||||
let language: String = self.Language()?.try_into()?;
|
||||
let language = LanguageTag::parse(language).unwrap();
|
||||
let language = LanguageIdentifier::from_str(&language).unwrap();
|
||||
Ok(Voice {
|
||||
id: self.Id()?.try_into()?,
|
||||
name: self.DisplayName()?.try_into()?,
|
||||
|
|
|
@ -27,12 +27,12 @@ use lazy_static::lazy_static;
|
|||
use libc::c_char;
|
||||
#[cfg(target_os = "macos")]
|
||||
use objc::{class, msg_send, sel, sel_impl};
|
||||
pub use oxilangtag::LanguageTag;
|
||||
#[cfg(target_os = "linux")]
|
||||
use speech_dispatcher::Error as SpeechDispatcherError;
|
||||
use thiserror::Error;
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
use tolk::Tolk;
|
||||
pub use unic_langid::LanguageIdentifier;
|
||||
|
||||
mod backends;
|
||||
|
||||
|
@ -659,7 +659,7 @@ pub struct Voice {
|
|||
pub(crate) id: String,
|
||||
pub(crate) name: String,
|
||||
pub(crate) gender: Option<Gender>,
|
||||
pub(crate) language: LanguageTag<String>,
|
||||
pub(crate) language: LanguageIdentifier,
|
||||
}
|
||||
|
||||
impl Voice {
|
||||
|
@ -675,7 +675,7 @@ impl Voice {
|
|||
self.gender
|
||||
}
|
||||
|
||||
pub fn language(&self) -> LanguageTag<String> {
|
||||
pub fn language(&self) -> LanguageIdentifier {
|
||||
self.language.clone()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue