From 126f14d6fb57d8cf601c5e816b27fa63582860e5 Mon Sep 17 00:00:00 2001 From: Jezra Date: Fri, 4 Jul 2014 12:24:21 -0700 Subject: Added a bit of error checking for the most common problem: missing gstreamer pocketsphinx plugin --- Recognizer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Recognizer.py b/Recognizer.py index 26ccd80..7bc2023 100755 --- a/Recognizer.py +++ b/Recognizer.py @@ -26,7 +26,12 @@ class Recognizer(gobject.GObject): #build the pipeline cmd = audio_src+' ! audioconvert ! audioresample ! vader name=vad ! pocketsphinx name=asr ! appsink sync=false' - self.pipeline=gst.parse_launch( cmd ) + try: + self.pipeline=gst.parse_launch( cmd ) + except Exception, e: + print e.message + print "You may need to install gstreamer0.10-pocketsphinx" + #get the Auto Speech Recognition piece asr=self.pipeline.get_by_name('asr') asr.connect('result', self.result) -- cgit 1.4.1