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

Using sound_play in ROS custom nodes written in c/c++

asked 2012-08-14 23:00:34 -0600

roboviz gravatar image

updated 2012-08-16 10:52:13 -0600

Hi all,

I successfully managed to get sound_play working on my machine.

I was just wondering if there is a way to use it through c/c++ code within my node.

I found something for python in but not for c/c++.

For the time being I used a system call within the code as follows: system("rosrun sound_play \"Hi There\"");

A small barebone example code would be greatly appreciated.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-09-11 10:39:09 -0600

ahendrix gravatar image

updated 2016-06-11 12:29:21 -0600

sound_play exposes a C++ API that's documented here:

There's a simple example here:

edit flag offensive delete link more


The links are broken

rodrigobdz gravatar image rodrigobdz  ( 2016-06-11 04:13:22 -0600 )edit

The links are now found under the docs directory for each distribution

rodrigobdz gravatar image rodrigobdz  ( 2016-06-11 04:32:51 -0600 )edit

Fixed the links. Thanks for catching that.

ahendrix gravatar image ahendrix  ( 2016-06-11 12:29:56 -0600 )edit

Question Tools


Asked: 2012-08-14 23:00:34 -0600

Seen: 2,331 times

Last updated: Jun 11 '16