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

sound_play playWave() is not playing sound

asked 2012-09-07 12:29:56 -0600

DocSmiley gravatar image

updated 2014-01-28 17:13:36 -0600

ngrennan gravatar image

I followed the directions I received in:

http://answers.ros.org/question/41385/play-a-sound-file-in-a-python-node/

I had the sound_play's soundClient functionality working for some time.

However it has inexplicably stopped working and I'm unsure as to why.

I'm starting the sound_playnode.py and running the following in another node.

The relevant lines from my node (and launch file) are:

<param name = "my_file" value = "file://$(find my_audio)/a_sound.wav" />

from sound_play.libsoundplay import SoundClient

soundhandle = SoundClient()
my_sound = rospy.get_param('my_file')
soundhandle.playWave(my_sound)

With numerous print statements I can tell that the soundhandle.playWave(my_sound) is being called and does not appear to generate an error, but no sound is played. I have tried the second method as well, but with the same results.

I can run

$rosrun sound_play play.py "/absolute/path/to/my_file.wav"

and get the sound to play every time.

Any help would be appreciated. Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-09-07 12:34:22 -0600

kszonek gravatar image

What about calling soundhandle.playWave('/absolute/path/to/my_file.wav'), does it work?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-07 12:29:56 -0600

Seen: 766 times

Last updated: Sep 07 '12