Rosanswers logo

I see this has been asked in the past but I have not seen an answer that works. Text to speech uses a very slow hard to understand voice. I followed http://ubuntuforums.org/showthread.php?t=751169 and installed the enhanced Nitech HTS voices. I ran festival from the command line and can hear the new voices. i tried editing the festival usr/share/festival/festival.scm file and added (set! voice_default 'voice_nitech_us_rms_arctic_hts) but when I do that and then try to get it to speak form my python program I get no speech out whatsoever. If I comment out that line my python program works just with the nasty voice. I also added the festival.scm file to /etc (there was not one there) like mentioned in another answer but when I do that again my sound disappears. I also tried modifying voices.scm and changing KAL to don but that still does not help. I think I have tried everything mentioned here. Has anyone figured out how to fix this? I'm using diamondback on ubunto 10.10.

Originally posted by ringo42 on ROS Answers with karma: 55 on 2011-08-06

Post score: 0


1 Answer 1


Rosanswers logo

Hi Ringo,

I have a possible solution for you below but first here is a summary of what I tried. I am using Ubuntu 10.04 with the festival debian packages obtained using the Synaptics package manager.

First I tried your scenario with the latest Diamondback debian packages and confirmed that I also get the slow low voice. (I reported this a while back as a bug.)

Next I tried it with the latest Electric beta debian packages and in this case, launching the sound_play node fails with the following error:

process[soundplay_node-2]: started with pid [5505]
Traceback (most recent call last):
  File "/opt/ros/electric/stacks/audio_common/sound_play/scripts/soundplay_node.py", line 49, in <module>
    from diagnostic_msgs.msg import DiagnosticStatus, KeyValue, DiagnosticArray
ImportError: No module named diagnostic_msgs.msg
[soundplay_node-2] process has died [pid 5505, exit code 1].
log files: /home/patrick/.ros/log/d13001dc-c1ef-11e0-9414-0022683b2a0b/soundplay_node-2*.log

The fix I have found that works with both Diamondback and Electric is to overlay the latest audio_common stack as follows:

$ cd /home/ringo/ros (or whatever your personal ROS directory is)
$ sudo apt-get install mercurial
$ hg clone `roslocate uri audio_common`
$ rosmake --rosdep-install audio_common

Then run:

$ rospack profile

in each of your terminal windows and try this test:

In the first terminal:

$ roslaunch sound_play soundplay_node.launch

and in the second terminal:

$ rosrun sound_play say.py "How do I sound now?"

IMPORTANT: In your Python program, you need to add a second argument to the SoundClient say() command. So this:

self.soundhandle = SoundClient()
self.soundhandle.say('Take me to your leader.')

becomes this:

self.soundhandle = SoundClient()
self.soundhandle.say('Take me to your leader.', '')

The second argument is for specifying the voice, but I have only tried setting it to the null string.

Hope that works for you!


Originally posted by Pi Robot with karma: 4046 on 2011-08-08

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Per Lenander on 2011-11-24:
Running Ubuntu 11.04 with the latest audio_common stack, I had the same problem as described above. I applied the last part of the solution (Set the voice to the null string, or "" in C++) and this works for me.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.