From 1d075f7ececc3a153bf23111014a798e7d82dbbe Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 12 Mar 2021 05:50:08 -0600 Subject: [PATCH] When speech is interrupted on AVFoundation, only stop if already speaking. May address a possible deadlock. --- src/backends/av_foundation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/av_foundation.rs b/src/backends/av_foundation.rs index a87bf69..6e5f38d 100644 --- a/src/backends/av_foundation.rs +++ b/src/backends/av_foundation.rs @@ -145,7 +145,7 @@ impl Backend for AvFoundation { fn speak(&mut self, text: &str, interrupt: bool) -> Result, Error> { trace!("speak({}, {})", text, interrupt); - if interrupt { + if interrupt && self.is_speaking()? { self.stop()?; } let utterance: id;