From 0438ad7c94e5b608124b3fd89571f0e43be2179d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Nov 2024 14:37:53 +0530 Subject: [PATCH] CS viewer: Fix read aloud broken after a configure with no changes --- src/pyj/read_book/tts.pyj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pyj/read_book/tts.pyj b/src/pyj/read_book/tts.pyj index b704015e3f..7d80484450 100644 --- a/src/pyj/read_book/tts.pyj +++ b/src/pyj/read_book/tts.pyj @@ -190,6 +190,7 @@ class Client: ut = self.current_utterance self.current_utterance = None ut.onstart = ut.onpause = ut.onend = ut.onerror = ut.onresume = None + ut.removeEventListener('boundary', self.utterance_boundary_reached) window.speechSynthesis.cancel() def resume_after_configure(self): @@ -313,12 +314,11 @@ class Client: self.current_rate = rate if bar_pos is not current_bar_pos: sd.set('tts_bar_position', bar_pos) - is_speaking = bool(window.speechSynthesis.speaking) - if is_speaking: - self.pause_for_configure() - self.save_settings() - if is_speaking: - self.resume_after_configure() - + is_speaking = bool(window.speechSynthesis.speaking) + if is_speaking: + self.pause_for_configure() + self.save_settings() + if is_speaking: + self.resume_after_configure() self.onevent('configured') )