环境:mac 10.12


安装指导文档:http://cmusphinx.sourceforge.net/wiki/tutorialpocketsphinx
1 安装brew --mac下安装软件的好工具
按该网站首页的提示安装:http://brew.sh
2 按指导文档下载最新的pocketsphinx安装相关的包
http://cmusphinx.sourceforge.net/wiki/download
sphinxbase-5prealpha
pocketsphinx-5prealpha
sphinxtrain-5prealpha
sphinx4-5prealpha


3 进入 sphinxbase目录,运行./autogen.sh
发现运行失败,缺少autoconf等,这个时候就用第一步中brew安装:brew install autoconf
反应有点慢,耐心等待


4 运行autogen.sh后,继续按指导文档运行./configure
发现配置失败,找不到swig。继续brew install swig
之后,重新运行 ./configure ,配置成功
接着编译 make
然后安装 make install
然后配置环境变量 vi ~/.bash_profile 加入如下两行
--------------------------------------------------
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
--------------------------------------------------


5 进入pocketsphinx目录,重复3-4步


6 测试是否安装成功:重开一个命令窗口,敲入pocketsphinx_continuous -inmic yes,然后对着麦克风说话,会打出如下信息(最后一个是识别的信息,说实话识别的并不准确,也许是笔者发音不准):
INFO: continuous.c(275): Ready....
INFO: continuous.c(261): Listening...
INFO: cmn_live.c(120): Update from < 38.55 14.36 -6.95  7.41 -32.52 17.70 -5.60 -8.21  0.62 -0.84 -3.90 -3.71  9.11 >
INFO: cmn_live.c(138): Update to   < 29.61  7.19 -8.26  3.10 -24.18 11.50 -9.10 -6.89  0.97 -0.41 -3.53 -2.59  1.36 >
INFO: ngram_search_fwdtree.c(1550):     3254 words recognized (17/fr)
INFO: ngram_search_fwdtree.c(1552):   637593 senones evaluated (3428/fr)
INFO: ngram_search_fwdtree.c(1556):  2767081 channels searched (14876/fr), 119842 1st, 105773 last
INFO: ngram_search_fwdtree.c(1559):     8165 words for which last channels evaluated (43/fr)
INFO: ngram_search_fwdtree.c(1561):   159375 candidate words for entering last phone (856/fr)
INFO: ngram_search_fwdtree.c(1564): fwdtree 1.07 CPU 0.574 xRT
INFO: ngram_search_fwdtree.c(1567): fwdtree 9.15 wall 4.919 xRT
INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 136 words
INFO: ngram_search_fwdflat.c(948):     2144 words recognized (12/fr)
INFO: ngram_search_fwdflat.c(950):   139672 senones evaluated (751/fr)
INFO: ngram_search_fwdflat.c(952):   209239 channels searched (1124/fr)
INFO: ngram_search_fwdflat.c(954):    11358 words searched (61/fr)
INFO: ngram_search_fwdflat.c(957):     7478 word transitions (40/fr)
INFO: ngram_search_fwdflat.c(960): fwdflat 0.07 CPU 0.037 xRT
INFO: ngram_search_fwdflat.c(963): fwdflat 0.07 wall 0.037 xRT
INFO: ngram_search.c(1250): lattice start node <s>.0 end node </s>.149
INFO: ngram_search.c(1276): Eliminated 2 nodes before end node
INFO: ngram_search.c(1381): Lattice has 525 nodes, 2470 links
INFO: ps_lattice.c(1380): Bestpath score: -4405
INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:149:184) = -263075
INFO: ps_lattice.c(1441): Joint P(O,S) = -296701 P(S|O) = -33626
INFO: ngram_search.c(872): bestpath 0.00 CPU 0.002 xRT
INFO: ngram_search.c(875): bestpath 0.00 wall 0.002 xRT
i know
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐