From 0786d2d1a9ebc5e80bb35617094b4e38f189d7c3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Sep 2024 19:13:53 +0530 Subject: [PATCH] Fix configure when not speaking causing a pause event --- src/calibre/gui2/tts2/manager.py | 4 ++-- src/calibre/gui2/tts2/piper.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tts2/manager.py b/src/calibre/gui2/tts2/manager.py index b2fe12b9df..ff3b468ca1 100644 --- a/src/calibre/gui2/tts2/manager.py +++ b/src/calibre/gui2/tts2/manager.py @@ -170,8 +170,8 @@ class TTSManager(QObject): rd = ResumeData() rd.is_speaking = self._tts is not None and self.state in ( QTextToSpeech.State.Speaking, QTextToSpeech.State.Synthesizing, QTextToSpeech.State.Paused) - self._resuming_after_configure = True - if self.state is not QTextToSpeech.State.Paused: + self._resuming_after_configure = rd.is_speaking + if self.state is not QTextToSpeech.State.Paused and rd.is_speaking: self.tts.pause() self.state_event.emit('pause') yield rd diff --git a/src/calibre/gui2/tts2/piper.py b/src/calibre/gui2/tts2/piper.py index 1dfa7821b3..59f7ed870d 100644 --- a/src/calibre/gui2/tts2/piper.py +++ b/src/calibre/gui2/tts2/piper.py @@ -237,7 +237,6 @@ class Piper(TTSBackend): def reload_after_configure(self) -> None: self.shutdown() - self.process @property def state(self) -> QTextToSpeech.State: