From bd8b1c81ff5c1a847d72e97d9e8640aa1fc19054 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 18 Jul 2022 20:10:06 +0530 Subject: [PATCH] Read aloud: Fix spurious error message on Linux about voices not being installed --- src/calibre/gui2/tts/linux.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tts/linux.py b/src/calibre/gui2/tts/linux.py index f9163856b0..1de7449951 100644 --- a/src/calibre/gui2/tts/linux.py +++ b/src/calibre/gui2/tts/linux.py @@ -68,7 +68,10 @@ class Client: if self.system_default_output_module is None: self.system_default_output_module = self.ssip_client.get_output_module() if self.system_default_output_module == '(null)': - raise ValueError(_('Speech dispatcher on this system is not configured with any available voices. Install some voices first.')) + mods = self.ssip_client.list_output_modules() + if not mods: + raise ValueError(_('Speech dispatcher on this system is not configured with any available voices. Install some voices first.')) + self.system_default_output_module = mods[0] if not self.settings_applied: self.apply_settings() self.set_use_ssml(use_ssml)