在ROS中使用中文语音交互(百度语音baidu_speech)

目前,ROS可以用的中文语音工具还是有一些的,功能也越来越丰富,但有一些有使用的限制,有一些用起来不是很方便。

这里以百度语音为例具体说明,参考链接如下:

1 http://wiki.ros.org/baidu_speech

2 https://github.com/DinnerHowe/baidu_speech

----

1. 概述

使用百度语音API实现语音识别和TTS的功能包,可以修改或自定义参数的示例代码。在开始本教程之前需要保证安装完成两个必须的Python库pyaudiopython-vlc。这个功能包提供了在ROS中使用百度语音的解决方案,可以同时应用于英语、汉语普通话和粤语,经过多台配置电脑的测试,包括indigo和kinetic,thinkpad、acer等。

注意:

$ sudo apt-get install python-pip portaudio19-dev vlc libvlc-dev

$ sudo pip install pyaudio

$ sudo pip install python-vlc

----

2. 软硬件需求

可以运行ROS的笔记本或硬件设备,麦克风和扬声器等并正确配置。

----

3. 功能包下载并编译

这个和之前所有ROS包非常类似。

relaybot@relaybot-desktop:~/Rob_Soft/Baidu_Speech$ catkin build

----------------------------------------------------------------------------
Profile:                     default
Extending:          [cached] /home/relaybot/catkin_ws/devel:/opt/ros/kinetic
Workspace:                   /home/relaybot/Rob_Soft/Baidu_Speech
----------------------------------------------------------------------------
Source Space:       [exists] /home/relaybot/Rob_Soft/Baidu_Speech/src
Log Space:          [exists] /home/relaybot/Rob_Soft/Baidu_Speech/logs
Build Space:        [exists] /home/relaybot/Rob_Soft/Baidu_Speech/build
Devel Space:        [exists] /home/relaybot/Rob_Soft/Baidu_Speech/devel
Install Space:      [unused] /home/relaybot/Rob_Soft/Baidu_Speech/install
DESTDIR:            [unused] None
----------------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
----------------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
----------------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
----------------------------------------------------------------------------
Workspace configuration appears valid.
----------------------------------------------------------------------------
[build] Found '1' packages in 0.0 seconds.                                     
[build] Package table is up to date.                                           
Starting  >>> baidu_speech                                                     
Finished  <<< baidu_speech                [ 0.5 seconds ]                      
[build] Summary: All 1 packages succeeded!                                     
[build]   Ignored:   None.                                                     
[build]   Warnings:  None.                                                     
[build]   Abandoned: None.                                                     
[build]   Failed:    None.                                                     
[build] Runtime: 0.5 seconds total. 

----

4. 功能包使用

relaybot@relaybot-desktop:~/Rob_Soft/Baidu_Speech$ roslaunch baidu_speech
simple_speaker.launch   simple_voice.launch     warning_speaker.launch

分别有三个示例launch:simple_speaker.launch,simple_voice.launch,warning_speaker.launch。

4.1. 文本发音-simple_speak

$ roslaunch baidu_speech simple_speaker.launch Gender:=man

参数等具体说明参考wiki,这里使用男声,运行过程如下。


----

4.2. 语音识别-simple_voice

$ roslaunch baidu_speech simple_voice.launch


----

发布、订阅主题以及详细的参数信息请参考wiki。当然还可以使用更多复杂应用,包括用中文语音控制机器人运动等,自行探索即可。


~End~

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zhangrelay

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值