我试图在安装它之后从pocketsphinx源运行livedemo.py并偶然发现pocketphinx问题。 缩小范围,问题在于pocketphinx gsteamer插件。
简单地运行:
gst-launch-0.10 autoaudiosrc ! audioconvert ! audioresample ! vader name=vad auto-threshold=true ! pocketsphinx name=asr ! fakesink
产生此调试输出(GST_DEBUG = *:2):
...
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
0:00:00.074397000 89084 0x7fe358c38690 WARN osxaudiosrc gstosxaudiosrc.c:292:gst_osx_audio_src_io_proc:<osxringbuffer0> AudioUnitRender returned -10863
0:00:00.085992000 89084 0x7fe358c38690 WARN osxaudiosrc gstosxaudiosrc.c:292:gst_osx_audio_src_io_proc:<osxringbuffer0> AudioUnitRender returned -10863
0:00:00.097520000 89084 0x7fe358c38690 WARN osxaudiosrc gstosxaudiosrc.c:292:gst_osx_audio_src_io_proc:<osxringbuffer0> AudioUnitRender returned -10863
...
当然没有任何东西通过pocketsphinx,也没有语音识别。 相比之下,这条线输出录音没有问题:
gst-launch-0.10 osxaudiosrc ! audioconvert ! audioresample ! wavenc ! filesink location=temp.wav
设定: 我尝试使用Homebrew和Macports的OS X Lion和Yosemite。 这是我在使用macports时所做的:
sudo port install python27
sudo port install python_select
sudo port select --set python python27
sudo port install py27-pygtk
sudo port install gstreamer010 gstreamer010-gst-plugins-bad gstreamer010-gst-plugins-good gstreamer010-gst-plugins-ugly
sudo port install py27-gst-python
构建并安装sphinxbase和pocketsphinx
sudo port install swig swig-python
git clone https://github.com/cmusphinx/sphinxbase.git
git clone https://github.com/cmusphinx/pocketsphinx.git
cd sphinxbase/
./autogen.sh
./configure --prefix=/opt/local/ --disable-debug --disable-dependency-tracking
sudo make install
cd ../pocketsphinx && ./autogen.sh
./configure --prefix=/opt/local/ --disable-dependency-tracking && sudo make install