Skip to content

Commit

Permalink
Set the utterance ID to None
Browse files Browse the repository at this point in the history
  • Loading branch information
alters-mit committed Jun 17, 2024
1 parent 2e3fa50 commit ebdad5d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions text/src/tts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ impl TTS {
let _ = tts.stop().is_ok();
}
self.speech.clear();
if self.callbacks {
*UTTERANCE_ID.lock() = None;
}
}
}

Expand Down Expand Up @@ -147,8 +150,7 @@ impl TTS {
match &self.tts {
Some(tts) => {
if self.callbacks {
let u = UTTERANCE_ID.lock();
u.is_some()
UTTERANCE_ID.lock().is_some()
} else {
tts.is_speaking().unwrap_or(false)
}
Expand All @@ -174,8 +176,7 @@ impl TTS {
#[cfg(not(target_os = "macos"))]
fn on_utter(&self, utterance: Option<UtteranceId>) {
if self.callbacks {
let mut u = UTTERANCE_ID.lock();
*u = utterance;
*UTTERANCE_ID.lock() = utterance;
}
}
}
Expand Down

0 comments on commit ebdad5d

Please sign in to comment.