4 import resource_retriever
 
   13     _default_voice = 
'kal' 
   22                 rospkg.RosPack().get_path(
'sound_play'),
 
   27         if voice 
is None or voice == 
'':
 
   29         if voice.endswith(
'.flitevox'):
 
   30             if voice.startswith(
'package://'):
 
   32             elif voice.startswith(
'/'):
 
   37         (wavfile, wavfilename) = tempfile.mkstemp(
 
   38             prefix=
'sound_play', suffix=
'.wav')
 
   40         cmd = 
"flite -voice {0} -t \"{1}\" -o {2}".format(
 
   41             voice, text, wavfilename)
 
   44             if os.stat(wavfilename).st_size == 0:
 
   49                 'Sound synthesis failed.' 
   51                 'Is a flite voice installed?' 
   52                 'Try running "rosdep satisfy sound_play|sh".' 
   53                 'Refer to http://wiki.ros.org/' 
   54                 'sound_play/Troubleshooting'