浏览代码

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

Jezra 10 年前
父节点
当前提交
126f14d6fb
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      Recognizer.py

+ 6
- 1
Recognizer.py 查看文件

@@ -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)

正在加载...
取消
保存