[orca] speechdispatcherfactory: Do not set voice name when it is the default



commit b8fb45a11b05be9be7a2299be160769a53e0a58d
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Tue Apr 20 20:18:42 2021 +0200

    speechdispatcherfactory: Do not set voice name when it is the default
    
    self._default_voice_name (i.e. "<synth_name> default voice") is just
    the end-user (translated, even!) label for asking for the default
    speech-dispatcher voice. We should not be asking speech-dispatcher a voice
    with that name, and just rely on the selection from the locale.

 src/orca/speechdispatcherfactory.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index 468c71790..b1740b762 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -261,7 +261,8 @@ class SpeechServer(speechserver.SpeechServer):
             pass
         else:
             name = acss_family.get(speechserver.VoiceFamily.NAME)
-            self._send_command(set_synthesis_voice, name)
+            if name != self._default_voice_name:
+                self._send_command(set_synthesis_voice, name)
 
     def _debug_sd_values(self, prefix=""):
         if debug.debugLevel > debug.LEVEL_INFO:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]