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

Revision history [back]

click to hide/show revision 1
initial version

From the 'Code API' link on the sound_play wiki page you can get to the documentation and example for the C++ SoundPlay client.

The function you probably want to use is playWaveFromPkg; it should look something like this:

int main(int argc, char ** argv) {
    ros::init(argc, argv, "example");

    ros::NodeHandle nh;
    sound_play::SoundClient sc;

    sc.playWaveFromPkg("sound_play", "sounds/BACKINGUP.ogg");

    ros::spin();
}

From the 'Code API' link on the sound_play wiki page you can get to the documentation and example for the C++ SoundPlay client.

The function you probably want to use is playWaveFromPkg; it should look something like this:

int main(int argc, char ** argv) {
    ros::init(argc, argv, "example");

    ros::NodeHandle nh;
    sound_play::SoundClient sc;

    sc.playWaveFromPkg("sound_play", "sounds/BACKINGUP.ogg");

    ros::spin();
}