1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-07-27 04:09:38 +00:00

When speech is interrupted on AVFoundation, only stop if already speaking. May address a possible deadlock.

This commit is contained in:
Nolan Darilek 2021-03-12 05:50:08 -06:00
parent a22ee53727
commit 1d075f7ece

View File

@ -145,7 +145,7 @@ impl Backend for AvFoundation {
fn speak(&mut self, text: &str, interrupt: bool) -> Result<Option<UtteranceId>, Error> {
trace!("speak({}, {})", text, interrupt);
if interrupt {
if interrupt && self.is_speaking()? {
self.stop()?;
}
let utterance: id;