0
$\begingroup$

Rosanswers logo

Hi,

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 http://ubuntuforums.org/showthread.php?t=751169 , 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) [soundplay_node.py, 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/say.py, 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.


Originally posted by pgrice on ROS Answers with karma: 196 on 2011-03-04

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.

http://ubuntuforums.org/showthread.php?t=751169

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?


Originally posted by William with karma: 17335 on 2011-03-05

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by joq with karma: 25443 on 2011-03-05

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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