Apply changes to tts settings on creation

This commit is contained in:
Kovid Goyal 2020-12-15 07:58:22 +05:30
parent b9972032e5
commit 8aa354729d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 2 deletions

View File

@ -27,7 +27,7 @@ class Client:
self.current_marked_text = self.last_mark = None self.current_marked_text = self.last_mark = None
self.dispatch_on_main_thread = dispatch_on_main_thread self.dispatch_on_main_thread = dispatch_on_main_thread
self.status = {'synthesizing': False, 'paused': False} self.status = {'synthesizing': False, 'paused': False}
self.settings = settings self.settings = settings or {}
self.ignore_next_stop_event = False self.ignore_next_stop_event = False
self.apply_settings() self.apply_settings()

View File

@ -64,7 +64,10 @@ class TTS(QObject):
@property @property
def tts_client(self): def tts_client(self):
if self._tts_client is None: if self._tts_client is None:
self._tts_client = self.tts_client_class(self.backend_settings, self.dispatch_on_main_thread_signal.emit) settings = self.backend_settings
self._tts_client = self.tts_client_class(settings, self.dispatch_on_main_thread_signal.emit)
if self._tts_client.settings != settings:
self.backend_settings = self._tts_client.settings
return self._tts_client return self._tts_client
def shutdown(self): def shutdown(self):