美文网首页
语音识别CMUSphinx(1)Windows下安装

语音识别CMUSphinx(1)Windows下安装

作者: Seeker_zz | 来源:发表于2018-08-06 09:28 被阅读92次

安装步骤主要参考http://cmusphinx.github.io/wiki/tutorialpocketsphinx/
Windows下便于使用Visual Studio进行代码编写和调试,Linux下便于运行和安装,请参考自身情况进行安装!
参考原文章打开sphinxbase.sln并编译完成后再来编译pocketsphinx.sln下的pocketsphinx_continuous,发现以下include错误:


我们来找一下这个文件在哪

添加到包含目录:

这个#include的问题解决了,又出现了link库的问题,接着添加:

error LNK2019: 无法解析的外部符号 _main,该符号在函数___tmainCRTStartup 中被引用

项目、属性、C/C++、附加包含目录:填写附加头文件所在目录 分号间隔多项
项目、属性、链接器、常规、附加库目录:填写附加依赖库所在目录 分号间隔多项
项目、属性、链接器、输入、附加依赖项:填写附加依赖库的名字.lib 空格或分号间隔多项

添加依赖库
依赖库所在位置

原文里提到

don’t forget to copy the sphinxbase.dll file to the bin folder. Otherwise the executable will fail to find this library

为了便于输出调试,把单独的项目的输出位置该为整个解决方案的输出目录:

Link
注意调试时也要修改对应的工作目录
需要把sphinxbase.dll复制到编译出来的pocketsphinx_continuous.exe所在的位置
最后来试一下效果:

Unlike on Linux, the path to the model is not preconfigured in Windows, so you have to specify for pocketsphinx_continuous where to find the model with the -hmm, -lm and -dict options.

需要加上-hmm -lm -dict等参数,且音频文件采样率为16000Hz

bin\Debug\x64\pocketsphinx_continuous.exe -infile testwav\hamburger.wav -hmm model\en-us\en-us -lm model\en-us\en-us.lm.bin -dict model\en-us\cmudict-en-us.dict
识别结果

相关文章

网友评论

      本文标题:语音识别CMUSphinx(1)Windows下安装

      本文链接:https://www.haomeiwen.com/subject/ipmppftx.html