How to fix a problem of sound_play for playing wave file in c++?
Hi everyone, I want to play a wave file by using soundplay in c++, the codes like: soundplay::SoundClient sc; sc.playWave("/root/Desktop/test.wav");
and it shows:
[WARN] [WallTime: 1475855177.583316] Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run soundplay_node.py?
but i have run it before, like:
root@lgx-robot:~/hlfws# rosrun soundplay soundplaynode.py [INFO] [WallTime: 1475853878.411334] soundplay node is ready to play sound
If i try to play it with python as is: rosrun sound_play play.py /root/Desktop/test.wav
it is ok and you could hear the sound of the wave file.
And if i run the command: rosrun sound_play say.py "hello world" it shows:
root@lgx-robot:~/hlfws# rosrun soundplay say.py "hello world" Saying: hello world Voice: voicekaldiphone
and i could hear the sound. My environment is ubuntu14.04 LTS, ros indigo. what should i do? Should some one would help me? thanks
Asked by 78226415 on 2016-10-08 20:09:21 UTC
Comments
From your description I can't tell why this is happening; it would be useful if you included the full source code for your program (or a simplified version of it that shows the problem). You may also want to inspect the ROS graph to make sure that your node is publishing on the correct topic.
Asked by ahendrix on 2016-11-10 01:03:40 UTC