ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hi Ringo,

The following works for me in Diamondback.

First add a dependency on sound_play to your package manifest.xml file:

<depend package="sound_play"/>

and re-run rosmake in your package directory.

Then launch the soundplay node from the command line or your launch file:

$ rosrun sound_play soundplay_node.py

or

<launch>
  <node name="soundplay_node" pkg="sound_play" type="soundplay_node.py"/>
</launch>

Finally, add the following Python snippets to your main speech script.

from sound_play.libsoundplay import SoundClient

self.soundhandle = SoundClient()
rospy.sleep(1)
self.soundhandle.say('Take me to your leader.')

--patrick