pyaudio安装
Mac和python3.7在一起是不配用pyaudio的!多么痛的领悟!
所以安装python3.6!
brew install portaudio
之后用pip安装pyaudio即可
swig安装
官网下载,执行configure、make、make install即可(我下载的是最新版本4.0.1)
pocketsphinx安装
直接pip3 install可能报错,所以需要用这个issue里面的方法安装:
https://github.com/bambocher/pocketsphinx-python/issues/28
也就是
Please try the following steps
- git clone –recursive https://github.com/bambocher/pocketsphinx-python
- cd pocketsphinx-python
- Edit file deps/sphinxbase/src/libsphinxad/ad_openal.c
- Change
#include <al.h>
#include <alc.h>
to
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
- python setup.py install