Fix spurious speaking/ready event pair generated by piper backend on stop

This commit is contained in:
Kovid Goyal 2024-09-03 17:17:53 +05:30
parent 672bdcc149
commit 9c565b70ed
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -214,7 +214,9 @@ class Piper(TTSBackend):
if self._process is not None:
if self._state is not QTextToSpeech.State.Ready or self._utterances_being_synthesized or self._utterances_being_spoken:
self.shutdown()
self.process
# We cannot re-create self.process here as that will cause the
# audio device to go to active state which will cause a
# speaking event to be generated
def shutdown(self) -> None:
if self._process is not None: