总述
对于设备的控制,最简单方便的交互当属语音控制了,目前市面上也有许多的离线语音控制模块,可以任意更换需要识别的语句,但是识别模型这块都是闭源的,能够配置改动的不多,PocketSphinx是一个开源的离线语音识别库,且能训练自己的语音识别模型。 安装下载
[url=]https://github.com/orgs/cmusphinx[/url]
编译sphinxbase - autogen.sh
- ./configure --prefix=install路径 ( ./configure --help 查看配置参数,例如交叉编译工具的设置等)
- make
- make install
pocketsphinx - autogen.sh
- ./configure --prefix=install路径 --with-sphinxbase=sphinxbase 生成的路径 ( ./configure --help 查看配置参数,例如交叉编译工具的设置等)
- make
- make install
识别简单识别: - pocketsphinx_continuous -infile file.wav
复制代码
默认使用的是pocketsphinx model路径下的模型文件,其他配置参数可通过
查看。 关键词识别需要生成自己的语言模型与字典。 1、创建一个txt文件,并加入需要识别的单词 2、通过 lmtool 生成lm与dic文件 3、测试: pocketsphinx_continuous -hmm (your hmm dir) -lm (your language model) -dict (your dication) -infile file.wav
|