标签:ashx eth dba 关闭 neu bom jpg uil dig
转自http://www.ncnynl.com/archives/201611/1069.html
ROS入门教程-编写科大讯飞语音SDK的ROS包
说明
xf-ros说明
@author ncnynl <1043931@qq.com>
@time 2016-11-12
@website http://www.ncnynl.com
要求:
安装依赖:
$ sudo apt-get update
$ sudo apt-get install libasound2-dev
下载:
$ cd ~
$ git clone https://github.com/ncnynl/xf-ros.git
$ cp -R xf-ros/xfei_asr ~/catkin_ws/src/
修改CMakelist.txt:
target_link_libraries(
asr_sample
${catkin_LIBRARIES}
/home/ubu/catkin_ws/src/xfei_asr/lib/libmsc.so -ldl -pthread
)
target_link_libraries
,修改/home/ubu/catkin_ws
为你自己的工作空间/home/xxxx/catkin_ws
修改代码:
同时更换自己下载sdk里面的libmsc.so到对应的xfei_asr/lib/libmsc.so
(根据网友武哥的测试需要更换才能成功!)编译:
$ cd ~/catkin_ws/
$ catkin_make
文件结构:
文件结构:
ubu@ubu:~/xf-ros/xfei_asr$ tree
.
├── CMakeLists.txt
├── include
│ ├── formats.h
│ ├── linuxrec.h
│ ├── msp_cmn.h
│ ├── msp_errors.h
│ ├── msp_types.h
│ ├── qisr.h
│ ├── qtts.h
│ ├── speech_recognizer.h
│ └── xfei_asr
├── lib
│ └── libmsc.so
├── package.xml
├── README.md
└── src
├── asr_sample.c
├── gm_continuous_digit.abnf
├── iat_publish_speak.cpp
├── iat_record.c
├── iat_sample.c
├── linuxrec.c
├── msc
│ ├── b0c4f74dc1f1bd969732c841500eff0d
│ │ ├── u.data
│ │ └── urec.data
│ └── msc.cfg
├── sch_speak.c
├── sch_text.c
├── source.txt
├── speech_recognizer.c
├── tts_sample.c
├── tts_sample.wav
├── tts_subscribe_speak.cpp
├── userwords.txt
└── wav
├── iflytek01.wav
├── iflytek02.wav
└── weather.pcm
使用说明:
所有的rosrun要在源目录执行,因为一些相对路径的目录在src目录下
)$ roscd xfei_asr/src
$ rosrun xfei_asr asr_sample
$ rosrun xfei_asr iat_sample
$ rosrun xfei_asr iat_record
$ rosrun xfei_asr tts_subscribe_speak
$ rosrun xfei_asr iat_publish_speak
$ roscore
$ rosrun xfei_asr tts_subscribe_speak
$ rostopic pub xfwords std_msgs/String "测试ncnynl.com"
因为我的电脑没有安装mplayer所以报错,
安装
$ sudo apt-get install mplayer
但还会有警告,关闭lirc即可
$ sudo vi /etc/mplayer/mplayer.conf
添加 nolirc=yes 即可
语音播放效果
$ roscore
$ rosrun xfei_asr iat_publish_speak
$ rostopic echo /xfspeech
$ rostopic echo /xfwords
$ rostopic pub xfwakeup std_msgs/String "ok"
标签:ashx eth dba 关闭 neu bom jpg uil dig
原文地址:http://www.cnblogs.com/CZM-/p/6195713.html