Fix configure when not speaking causing a pause event

This commit is contained in:
Kovid Goyal 2024-09-03 19:13:53 +05:30
parent 56df2115a8
commit 0786d2d1a9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 3 deletions

View File

@ -170,8 +170,8 @@ class TTSManager(QObject):
rd = ResumeData() rd = ResumeData()
rd.is_speaking = self._tts is not None and self.state in ( rd.is_speaking = self._tts is not None and self.state in (
QTextToSpeech.State.Speaking, QTextToSpeech.State.Synthesizing, QTextToSpeech.State.Paused) QTextToSpeech.State.Speaking, QTextToSpeech.State.Synthesizing, QTextToSpeech.State.Paused)
self._resuming_after_configure = True self._resuming_after_configure = rd.is_speaking
if self.state is not QTextToSpeech.State.Paused: if self.state is not QTextToSpeech.State.Paused and rd.is_speaking:
self.tts.pause() self.tts.pause()
self.state_event.emit('pause') self.state_event.emit('pause')
yield rd yield rd

View File

@ -237,7 +237,6 @@ class Piper(TTSBackend):
def reload_after_configure(self) -> None: def reload_after_configure(self) -> None:
self.shutdown() self.shutdown()
self.process
@property @property
def state(self) -> QTextToSpeech.State: def state(self) -> QTextToSpeech.State: