[orca] Sanity check the value of the voice's family and fix it if bogus



commit 316f3608861ebe7a7ec7c648987f8e87ce55dd37
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Jul 18 23:05:53 2016 -0400

    Sanity check the value of the voice's family and fix it if bogus

 src/orca/speech.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/speech.py b/src/orca/speech.py
index 8cd0506..457a944 100644
--- a/src/orca/speech.py
+++ b/src/orca/speech.py
@@ -34,6 +34,7 @@ from . import logger
 from . import orca_state
 from . import settings
 from . import speech_generator
+from .speechserver import VoiceFamily
 
 from .acss import ACSS
 
@@ -125,6 +126,12 @@ def init():
 
 def __resolveACSS(acss=None):
     if isinstance(acss, ACSS):
+        family = acss.get(acss.FAMILY)
+        try:
+            family = VoiceFamily(family)
+        except:
+            family = VoiceFamily({})
+        acss[acss.FAMILY] = family
         return acss
     elif isinstance(acss, list) and len(acss) == 1:
         return ACSS(acss[0])


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