Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--espeak_gst.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/espeak_gst.py b/espeak_gst.py
index a492cf6..9234bd6 100644
--- a/espeak_gst.py
+++ b/espeak_gst.py
@@ -26,9 +26,15 @@ RATE_MAX = 200
class AudioGrabGst(espeak.BaseAudioGrab):
def speak(self, status, text):
# XXX workaround for http://bugs.sugarlabs.org/ticket/1801
- if not [i for i in unicode(text, 'utf-8', errors='ignore') \
- if i.isalnum()]:
- return
+ try:
+ if not [i for i in unicode(text, 'utf-8', errors='ignore') \
+ if i.isalnum()]:
+ return
+ except TypeError:
+ # XXX already Unicode? (fixes http://tareas.somosazucar.org/hxp/issue7)
+ if not [i for i in text if i.isalnum()]:
+ return
+
self.make_pipeline('espeak name=espeak ! wavenc')
src = self.pipeline.get_by_name('espeak')