[orca] Fix bug causing us to not always use the system voice



commit ce1c9e4ef38e0f6b3a0cb7a657ad94deb512bbcc
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Fri Jan 31 14:19:48 2020 -0500

    Fix bug causing us to not always use the system voice
    
    The speech generator doesn't use the system voice when it's not been
    "established." The preferences GUI wasn't setting that key. In contrast,
    the message presentation doesn't check for that. Having fixed the bug
    with "established", the system voice will now be used for everything it
    was meant (coded) to. If that produces unexpected results, we can tweak
    the "meant (coded) to" as needed.

 src/orca/orca_gui_prefs.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 5c577950b..a7ece7247 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -466,20 +466,21 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         family = self._getKeyValueForVoiceType(voiceType,
                                                acss.ACSS.FAMILY,
                                                False)
+
+        voiceACSS = self._getACSSForVoiceType(voiceType)
         if family:
             family[speechserver.VoiceFamily.NAME] = name
             family[speechserver.VoiceFamily.LANG] = language
             family[speechserver.VoiceFamily.DIALECT] = dialect
             family[speechserver.VoiceFamily.VARIANT] = variant
         else:
-            voiceACSS = self._getACSSForVoiceType(voiceType)
             voiceACSS[acss.ACSS.FAMILY] = {}
             voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.NAME] = name
             voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.LANG] = language
             voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.DIALECT] = dialect
             voiceACSS[acss.ACSS.FAMILY][speechserver.VoiceFamily.VARIANT] = variant
+        voiceACSS['established'] = True
 
-        #voiceACSS = self._getACSSForVoiceType(voiceType)
         #settings.voices[voiceType] = voiceACSS
 
     def _getRateForVoiceType(self, voiceType):
@@ -504,6 +505,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
 
         voiceACSS = self._getACSSForVoiceType(voiceType)
         voiceACSS[acss.ACSS.RATE] = value
+        voiceACSS['established'] = True
         #settings.voices[voiceType] = voiceACSS
 
     def _getPitchForVoiceType(self, voiceType):
@@ -529,6 +531,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
 
         voiceACSS = self._getACSSForVoiceType(voiceType)
         voiceACSS[acss.ACSS.AVERAGE_PITCH] = value
+        voiceACSS['established'] = True
         #settings.voices[voiceType] = voiceACSS
 
     def _getVolumeForVoiceType(self, voiceType):
@@ -553,6 +556,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
 
         voiceACSS = self._getACSSForVoiceType(voiceType)
         voiceACSS[acss.ACSS.GAIN] = value
+        voiceACSS['established'] = True
         #settings.voices[voiceType] = voiceACSS
 
     def _setVoiceSettingsForVoiceType(self, voiceType):


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