Browse Source

Added a bit of error checking for the most common problem: missing gstreamer pocketsphinx plugin

Jezra 9 years ago
parent
commit
126f14d6fb
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      Recognizer.py

+ 6
- 1
Recognizer.py View File

@@ -26,7 +26,12 @@ class Recognizer(gobject.GObject):
26 26
 
27 27
 		#build the pipeline
28 28
 		cmd = audio_src+' ! audioconvert ! audioresample ! vader name=vad ! pocketsphinx name=asr ! appsink sync=false'
29
-		self.pipeline=gst.parse_launch( cmd )
29
+		try:
30
+			self.pipeline=gst.parse_launch( cmd )
31
+		except Exception, e:
32
+			print e.message
33
+			print "You may need to install gstreamer0.10-pocketsphinx"
34
+
30 35
 		#get the Auto Speech Recognition piece
31 36
 		asr=self.pipeline.get_by_name('asr')
32 37
 		asr.connect('result', self.result)

Loading…
Cancel
Save