1.安装依赖
1.1安装ros-kinetic-audio-common
sudo apt-get install ros-kinetic-audio-common
1.2 安装libasound2
sudo apt-get install libasound2
1.3 安装libgstreamer0.10
sudo apt-get install gstreamer0.10-*
1.4安装python-gst0.10
sudo apt-get install python-gst0.10
2.安装 libsphinxbase1
下载地址:https://packages.debian.org/jessie/libsphinxbase1
sudo dpkg -i libsphinxbase1_0.8-6_amd64.deb
3. 安装libpocketsphinx1
下载地址:https://packages.debian.org/jessie/libpocketsphinx1
sudo dpkg -i libpocketsphinx1_0.8-5_amd64.deb
4.安装gstreamer0.10-pocketsphinx
下载地址:https://packages.debian.org/jessie/gstreamer0.10-pocketsphinx
sudo dpkg -i gstreamer0.10-pocketsphinx_0.8-5_amd64.deb
5.安装pocketsphinx
5.1进入工作空间,git源码
cd ~/dev/catkin_ws/src
git clone https://github.com/mikeferguson/pocketsphinx
5.2下载英文语音包pocketsphinx-hmm-en-tidigits (0.8-5)
下载的网站:https://packages.debian.org/jessie/pocketsphinx-hmm-en-tidigits
sudo dpkg -i pocketsphinx-hmm-en-tidigits_0.8-5_all.deb
会加压安装到/usr/share/目录如下所示
/usr/share/doc/pocketsphinx-hmm-en-tidigits/changelog.Debian.gz
/usr/share/doc/pocketsphinx-hmm-en-tidigits/changelog.gz
/usr/share/doc/pocketsphinx-hmm-en-tidigits/copyright
/usr/share/pocketsphinx/model/hmm/en/tidigits/feat.params
/usr/share/pocketsphinx/model/hmm/en/tidigits/mdef
/usr/share/pocketsphinx/model/hmm/en/tidigits/means
/usr/share/pocketsphinx/model/hmm/en/tidigits/sendump
/usr/share/pocketsphinx/model/hmm/en/tidigits/transition_matrices
/usr/share/pocketsphinx/model/hmm/en/tidigits/variances
/usr/share/pocketsphinx/model/lm/en/tidigits.DMP
/usr/share/pocketsphinx/model/lm/en/tidigits.dic
/usr/share/pocketsphinx/model/lm/en/tidigits.fsg
在包pocketsphinx下面建一个model目录,存放语音模型文件
cd ~/dev/catkin_ws/src/pocketsphinx
mkdir model
将下载好的语音文件,解压后,将其中的model文件下的所有文件拷贝到~/dev/catkin_ws/src/pocketsphinx/model下,也可以不复制。
6 启动pocketsphinx测试
直接运行pocketsphinx启动脚本命令“roslaunch pocketsphinx robocup.launch”会出现如下错误,
为此,首先我对recognizer.py的做了如下修改:
1)注释掉self.asr.set_property('configured', True)
2)添加lm,dict,hmm支持英语识别(如果是其他语言(如普通话)可以改为别的路径)
self.asr.set_property('lm', '/usr/share/pocketsphinx/model/lm/en/tidigits.DMP')
self.asr.set_property('dict', '/usr/share/pocketsphinx/model/lm/en/tidigits.dic')
self.asr.set_property('hmm', '/usr/share/pocketsphinx/model/hmm/en/tidigits')
这些安装好之后,可以开始测试pocketsphinx的语音识别功能了:
1.终端运行launch启动文件:
roslaunch pocketsphinx robocup.launch
2.尝试说一些简单的语句,(如果使用英文库,说一些数字;如果使用普通话库讲中文),查看识别结果
3.用rostopic echo进行查看识别的输出,即ROS发布的结果消息)
rostopic echo /recognizer/output
7.也可以下载其他包进行测试
中文普通话
pocketsphinx-hmm-zh-tdt https://packages.debian.org/jessie/pocketsphinx-hmm-zh-tdt
pocketsphinx-lm-zh-hans-gigatdt https://packages.debian.org/jessie/pocketsphinx-lm-zh-hans-gigatdt
后期考虑在launch文件中设置参数,在recognizer.py加载参数的读取
参考:http://blog.csdn.net/x_r_su/article/details/53022746?locationNum=1&fps=1
http://www.ncnynl.com/archives/201701/1220.html
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com