From 6bd4c506bb22c98a81331fb5a22b8a9055904149 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 2 Feb 2023 12:43:10 +0530 Subject: [PATCH] Fix changing sound output not working --- src/calibre/gui2/tts/windows.py | 6 ++++++ src/calibre/utils/windows/winspeech.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tts/windows.py b/src/calibre/gui2/tts/windows.py index 18e8644079..a8ad597075 100644 --- a/src/calibre/gui2/tts/windows.py +++ b/src/calibre/gui2/tts/windows.py @@ -159,14 +159,20 @@ class Client: try: self.backend.set_voice(self.settings.get('voice'), self.default_system_voice) except OSError: + import traceback + traceback.print_exc() self.settings.pop('voice', None) try: self.backend.set_rate(self.settings.get('rate', self.default_system_rate)) except OSError: + import traceback + traceback.print_exc() self.settings.pop('rate', None) try: self.backend.set_audio_device(self.settings.get('sound_output'), self.default_system_audio_device) except OSError: + import traceback + traceback.print_exc() self.settings.pop('sound_output', None) if was_synthesizing: self.resume_after_configure() diff --git a/src/calibre/utils/windows/winspeech.py b/src/calibre/utils/windows/winspeech.py index 0727508ac9..476f56a070 100644 --- a/src/calibre/utils/windows/winspeech.py +++ b/src/calibre/utils/windows/winspeech.py @@ -313,7 +313,7 @@ def parse_message(line): return AllAudioDevices(**ans) if msg_type == 'audio_device': if ans['device']: - ans['device'] = DeviceInformation(ans['device']) + ans['device'] = DeviceInformation(**ans['device']) else: ans['device'] = None return AudioDevice(**ans)