Explorar el Código

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

Jezra hace 10 años
padre
commit
126f14d6fb
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6
    1
      Recognizer.py

+ 6
- 1
Recognizer.py Ver fichero

@@ -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…
Cancelar
Guardar