This page is here to discuss the joys of a talking robot. Why would you want to have a talking robot you may ask? My answer is because it is the future--That's why! A better question would be why not? For this we will be using a tts built special for ROS. This package is called sound_play.
To be quite honest, I haven't done too much with this because I think I am getting better at ROS, and everything is starting to just click. By that, I mean I am not having to learn as much by failure because I am learning how to do it correctly--because I have learned how not to fail so much. As much as I feel that would be a underhanded complement if I were looking from a perspective of having not banged my head into the wall as many times as I have trying to learn ROS. Instead, this is like my verbal planting of my flag on ROS mountain; so what it it is still at the base of the mountain!?!?
There are two ways of playing with this. Any one who knows more about ROS than I do will probably argue that there are probably more, but I will only focus on using rosrun and roslaunch methods of getting this to work.
I suppose before we get started I should introduce the method fo installing it. Lets use apt-get. I started with a apt-cache search sound-play--which gave me this: ros-melodic-sound-play - sound_play provides a ROS node that translates commands on a ROS topic (robotsound) into sounds. So I took the "ros-melodic-sound-play" and threw it into apt-get install ros-melodic-sound-play, and that was that. *I lost a hard drive since starting this project (I have took way too long on this) that's why i am on melodic.*
Now to run the magical test we will type roslaunch sound_play test.launch. This will launch all of the files necessary to make stuff happen. Lets now do the more fun version using rosrun.
We will need 3 terminals to run the stuff to make our ROS talk. We will need one to run roscore, one to run rosrun sound_play soundplay_node.py, and the last to run: rosrun sound_play say.py 'Stephen Hawking has nothing on my sexy voice' . **That may have been in bad taste. My apologies to anyone expecting more from a poorly educated guy trying to get out of mowing his yard--I will try to do better next time. ** You should be hearing something sounding like a voice coming from your computer saying the phrase you put between the ''marks.
Try not to have too much fun with this.
Last edited: 5/29/21