diff options
author | Jezra <jezra@jezra.net> | 2014-07-04 12:24:21 -0700 |
---|---|---|
committer | Jezra <jezra@jezra.net> | 2014-07-04 12:24:21 -0700 |
commit | 126f14d6fb57d8cf601c5e816b27fa63582860e5 (patch) | |
tree | 9af5bef79422f9183a3b5c22eaa3a2e697cf28f9 | |
parent | 810d17c7a66c240c84e7818ece0c3e63caea4bc6 (diff) |
Added a bit of error checking for the most common problem: missing gstreamer pocketsphinx plugin
-rwxr-xr-x | Recognizer.py | 7 |
1 files changed, 6 insertions, 1 deletions
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) |