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
1 changed files with 1 additions and 1 deletions

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;