一、PocketSphinx 安装
1、RedHat/CentOS:
yum install pulseaudio-libs-devel
Ubuntu/Debian:
apt install libpulse-dev
2、git clone --recursive https://github.com/bambocher/pocketsphinx-python
3、cd pocketsphinx-python
4、vim pocketsphinx-python/deps/sphinxbase/src/libsphinxad/ad_openal.c
Change
#include
#include
to
#include
#include
5、python setup.py install
二、SpeechRecognition安装
pip install SpeechRecognition
三、中文模型安装
1、下载 cmusphinx-zh-cn-5.2.tar.gz
地址:
https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Mandarin/
2、解压后重命名部分文件:
cmusphinx-zh-cn-5.2 -> zh-CN
zh_cn.cd_cont_5000 -> acoustic-model
zh_cn.lm.bin -> language-model.lm.bin
zh_cn.dic -> pronounciation-dictionary.dict
<