mirror of https://github.com/ndarilek/tts-rs.git
Fix type mismatches after speech-dispatcher update.
This commit is contained in:
parent
eb1d13976a
commit
f5716c48f5
|
@ -12,8 +12,8 @@ use crate::{Backend, BackendId, Error, Features, UtteranceId, Voice, CALLBACKS};
|
||||||
pub(crate) struct SpeechDispatcher(Connection);
|
pub(crate) struct SpeechDispatcher(Connection);
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref SPEAKING: Mutex<HashMap<u64, bool>> = {
|
static ref SPEAKING: Mutex<HashMap<usize, bool>> = {
|
||||||
let m: HashMap<u64, bool> = HashMap::new();
|
let m: HashMap<usize, bool> = HashMap::new();
|
||||||
Mutex::new(m)
|
Mutex::new(m)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ impl SpeechDispatcher {
|
||||||
let mut callbacks = CALLBACKS.lock().unwrap();
|
let mut callbacks = CALLBACKS.lock().unwrap();
|
||||||
let backend_id = BackendId::SpeechDispatcher(client_id);
|
let backend_id = BackendId::SpeechDispatcher(client_id);
|
||||||
let cb = callbacks.get_mut(&backend_id).unwrap();
|
let cb = callbacks.get_mut(&backend_id).unwrap();
|
||||||
let utterance_id = UtteranceId::SpeechDispatcher(msg_id);
|
let utterance_id = UtteranceId::SpeechDispatcher(msg_id as u64);
|
||||||
if let Some(f) = cb.utterance_begin.as_mut() {
|
if let Some(f) = cb.utterance_begin.as_mut() {
|
||||||
f(utterance_id);
|
f(utterance_id);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ impl SpeechDispatcher {
|
||||||
let mut callbacks = CALLBACKS.lock().unwrap();
|
let mut callbacks = CALLBACKS.lock().unwrap();
|
||||||
let backend_id = BackendId::SpeechDispatcher(client_id);
|
let backend_id = BackendId::SpeechDispatcher(client_id);
|
||||||
let cb = callbacks.get_mut(&backend_id).unwrap();
|
let cb = callbacks.get_mut(&backend_id).unwrap();
|
||||||
let utterance_id = UtteranceId::SpeechDispatcher(msg_id);
|
let utterance_id = UtteranceId::SpeechDispatcher(msg_id as u64);
|
||||||
if let Some(f) = cb.utterance_end.as_mut() {
|
if let Some(f) = cb.utterance_end.as_mut() {
|
||||||
f(utterance_id);
|
f(utterance_id);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ impl SpeechDispatcher {
|
||||||
let mut callbacks = CALLBACKS.lock().unwrap();
|
let mut callbacks = CALLBACKS.lock().unwrap();
|
||||||
let backend_id = BackendId::SpeechDispatcher(client_id);
|
let backend_id = BackendId::SpeechDispatcher(client_id);
|
||||||
let cb = callbacks.get_mut(&backend_id).unwrap();
|
let cb = callbacks.get_mut(&backend_id).unwrap();
|
||||||
let utterance_id = UtteranceId::SpeechDispatcher(msg_id);
|
let utterance_id = UtteranceId::SpeechDispatcher(msg_id as u64);
|
||||||
if let Some(f) = cb.utterance_stop.as_mut() {
|
if let Some(f) = cb.utterance_stop.as_mut() {
|
||||||
f(utterance_id);
|
f(utterance_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ pub enum BackendId {
|
||||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||||
AvFoundation(u64),
|
AvFoundation(u64),
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
SpeechDispatcher(u64),
|
SpeechDispatcher(usize),
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
Web(u64),
|
Web(u64),
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
|
Loading…
Reference in New Issue