在 https://cmusphinx.github.io/wiki/download/
下载
sphinxbase-5prealpha.tar.gz
pocketsphinx-5prealpha.tar.gz
./autogen.sh ./configure --prefix=/usr/local/sphinxbase make make install ./autogen.sh ./configure --prefix=/usr/local/pocketsphinx make make install
参考
https://cmusphinx.github.io/wiki/tutorialpocketsphinx/#installation-on-unix-system
下载声学模型
[url] https://sourceforge.net/projects/cmusphinx/files/Acoustic and Language Models/[/url]
cmusphinx-zh-cn-5.2.tar.gz
解压到/usr/local/pocketsphinx/share/pocketsphinx/model/cmusphinx-zh-cn-5.2
需要三个重要文件
运行
/usr/local/pocketsphinx/bin/pocketsphinx_continuous -inmic yes -hmm ../share/pocketsphinx/model/cmusphinx-zh-cn-5.2/zh_cn.cd_cont_5000 -lm ../share/pocketsphinx/model/cmusphinx-zh-cn-5.2/zh_cn.lm.bin -dict ../share/pocketsphinx/model/cmusphinx-zh-cn-5.2/zh_cn.dic
例子参考
http://www.zhaomingming.cn/ruyimoshishibie_mysql/ruyimoshishibie_mysql/content_ruyi.php?id=506
根据cmusphinx-zh-cn-5.2/zh_cn.dic 中的
4648.dic
关闭 g uan1 b i4 打开 d a3 k ai1 浏览器 l iu2 l an3 q i4 窗口 ch uang1 k ou3 记事本 j i4 sh ix4 b en3 纯音乐 ch un2 ii in1 vv ve4
打开
/usr/local/pocketsphinx/bin/pocketsphinx_continuous -inmic yes -hmm /usr/local/pocketsphinx/share/pocketsphinx/model/cmusphinx-zh-cn-5.2/zh_cn.cd_cont_5000 -lm ./4648.lm -dict ./4648.dic
pocketsphinx_continuous -hmm zh_broadcastnews_ptm256_8000 -lm zh_broadcastnews_64000_utf8.DMP -dict zh_broadcastnews_utf8.dic -infile myfile-16000.wav > myfile.txt