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

sound_play "" can read the same text only once

asked 2012-12-16 20:07:51 -0600

weiin gravatar image

updated 2012-12-19 13:29:15 -0600

I am trying to run the test.cpp in sound_play but the code to repeat a string does not seem to work. The sentence is read once, and that's it. I was expecting to hear "I am annoying." multiple times until sc.stopSaying is issued.

So I tried to do it manually with a simple:

       sc.say("Hello world!");
       sleepok(2, nh);
       sc.say("Hello world!");
       sleepok(2, nh);
       sc.say("Hello world!");
       sleepok(2, nh);

Only the first "Hello world!" in the first iteration is read out, and silence after that. Even in command line, I tried entering rosrun sound_play 'Hello world' multiple times (entering the line again after the sentence is read), and only the first time works.

I know from rostopic echo /robotsound that the message is being published, so what is going wrong here?

EDIT 20/12/12

changing the sleep time to 30 seconds works for sc.say(...) Minimum sleep time seems to be 11. sc.repeat(...) does not work for any of the sleep time that works with sc.say(...)

edit retag flag offensive close merge delete


I've noticed this too (I think it also happens when playing sound files). This is almost definitely a bug in sound_play.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2012-12-17 03:56:32 -0600 )edit

Which version of sound_play are you using? Does it work if you increase the sleep time to 30 seconds?

ahendrix gravatar image ahendrix  ( 2012-12-18 15:08:50 -0600 )edit

Hi Austin, I'm using the electric version 0.1.5.

weiin gravatar image weiin  ( 2012-12-19 13:25:39 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-12-21 04:45:20 -0600

ahendrix gravatar image

This was reported as bug #7 and is fixed in sound_play version 0.1.9 in Fuerte and Groovy; see the changelist

0.1.9 isn't officially supported on Electric, but if I remember correctly, there weren't a lot of big changes, so it should be possible to check out the audio_common-0.1.9 tag and run it against Electric.

edit flag offensive delete link more

Question Tools


Asked: 2012-12-16 20:07:51 -0600

Seen: 385 times

Last updated: Dec 21 '12