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

Changing Festival voice used by ROS.

asked 2011-03-04 08:48:29 -0600

pgrice gravatar image

updated 2014-01-28 17:09:16 -0600

ngrennan gravatar image


I am trying to incorporate text-to-speech for speech production while teleoperating a PR2, and am attempting to change the default voice used by the 'sound_play' node. As per , I have added improved voices to festival on the robot, and used (set! voice_default 'voice_nitech_us_rms_arctic_hts) in the /etc/festival.scm file. When I run festival from the command line, the improved default voice is used. Additionally, I created a python script which makes essentially the same call that I believe the soundplay node is making : os.system('text2wave '+txtfilename+' -o '+wavfilename) [, l. 192], which converts the text in a sample file to a .wav file using the correct voice.

Since making the changes, the robot has been stopped/started, and other users have confirmed the improved voice. However, whenever I publish text for speech via the SoundRequest topic, or use the sound_play/, the resulting speech uses the original unchanged voice. I cannot see anywhere that ros sets the Festival voice to use, but may have missed something.

Any further direction would be most appreciated.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-03-05 08:45:03 -0600

William gravatar image

updated 2011-03-05 08:45:56 -0600

In this forum post someone details how to install and set default voices for festival under ubuntu, an undergraduate group here is using it to select their voices. This doesn't give you the ability to select the voice in the message sent to sound_play, but rather sets it for the whole system.

Particularly I think you would be interested in this config file (/etc/festival.scm):

;;;; setup audio output

;;;; defaults to oss output

;;;; use pulseaudio to output sound
;;(Parameter.set 'Audio_Command "paplay $FILE") 
;;(Parameter.set 'Audio_Method 'Audio_Command)
;;(Parameter.set 'Audio_Required_Format 'snd)

;;;; use esd to output sound
;;(Parameter.set 'Audio_Command "esdplay $FILE") 
;;(Parameter.set 'Audio_Method 'Audio_Command)
;;(Parameter.set 'Audio_Required_Format 'snd)

;;;; use alsa to output sound
;;(Parameter.set 'Audio_Command "aplay -D plug:dmix -q -c 1 -t raw -f s16 -r $SR $FILE") 
;;(Parameter.set 'Audio_Method 'Audio_Command)
;;(Parameter.set 'Audio_Required_Format 'snd)

;;;; setup voices

;;;; Festvox voices
;;(set! default_voice 'voice_rab_diphone)
;;(set! default_voice 'voice_don_diphone)
;;(set! default_voice 'voice_kal_diphone)
;;(set! default_voice 'voice_ked_diphone)

;;;; MBROLA voices
;;(set! default_voice 'voice_us1_mbrola)
;;(set! default_voice 'voice_us2_mbrola)
;;(set! default_voice 'voice_us3_mbrola)

;;;; CMU Arctic voices
;;(set! voice_default 'voice_cmu_us_rms_arctic_clunits)
;;(set! voice_default 'voice_cmu_us_bdl_arctic_clunits)
;;(set! voice_default 'voice_cmu_us_slt_arctic_clunits)
;;(set! voice_default 'voice_cmu_us_clb_arctic_clunits)
;;(set! voice_default 'voice_cmu_us_awb_arctic_clunits)
;;(set! voice_default 'voice_cmu_us_jmk_arctic_clunits)

;;;; Nitech HTS voices
(set! voice_default 'voice_nitech_us_rms_arctic_hts)
;;(set! voice_default 'voice_nitech_us_bdl_arctic_hts)
;;(set! voice_default 'voice_nitech_us_slt_arctic_hts)
;;(set! voice_default 'voice_nitech_us_clb_arctic_hts)
;;(set! voice_default 'voice_nitech_us_awb_arctic_hts)
;;(set! voice_default 'voice_nitech_us_jmk_arctic_hts)
;;(set! voice_default 'voice_cmu_us_kal_com_hts)
;;(set! voice_default 'voice_cstr_us_ked_timit_hts)

;;;; Advanced voice configuration

;;;; Slow the HTS speech down.
;;(set! hts_duration_stretch 0.1)

;;;; Slow the standard voices down
;;(Parameter.set 'Duration_Stretch 2.5)

;;;; Set volume.
;;(set! default_after_synth_hooks
;;    (list (lambda (utt) (utt.wave.rescale utt 2.0 t))))

Also, does anyone know how tell the syntax highlighting which language you are using?

edit flag offensive delete link more

answered 2011-03-05 00:38:23 -0600

joq gravatar image

Looks like there is a patch you could try associated with ticket #4107.

It's not a very big patch, I expect it could be committed and released if you express interest. Testing the patch and noting (in the ticket) whether it fixes your problem would be helpful.

edit flag offensive delete link more

answered 2011-03-04 18:46:38 -0600

updated 2011-03-04 18:47:00 -0600

Something like this has been discussed on ros-users:

edit flag offensive delete link more

Question Tools


Asked: 2011-03-04 08:48:29 -0600

Seen: 4,673 times

Last updated: Mar 05 '11