mirror of https://github.com/ndarilek/tts-rs.git
When speech is interrupted on AVFoundation, only stop if already speaking. May address a possible deadlock.
This commit is contained in:
parent
a22ee53727
commit
1d075f7ece
|
@ -145,7 +145,7 @@ impl Backend for AvFoundation {
|
||||||
|
|
||||||
fn speak(&mut self, text: &str, interrupt: bool) -> Result<Option<UtteranceId>, Error> {
|
fn speak(&mut self, text: &str, interrupt: bool) -> Result<Option<UtteranceId>, Error> {
|
||||||
trace!("speak({}, {})", text, interrupt);
|
trace!("speak({}, {})", text, interrupt);
|
||||||
if interrupt {
|
if interrupt && self.is_speaking()? {
|
||||||
self.stop()?;
|
self.stop()?;
|
||||||
}
|
}
|
||||||
let utterance: id;
|
let utterance: id;
|
||||||
|
|
Loading…
Reference in New Issue