License - MIT
Maintainer - zhi.tan@ri.cmu.edu
A ROS wrapper for Amazon Polly Text-to-Speech service. We also cache locally each soundfile, so if you ever repeat the same sentence with the same voice, a local copy of the audio will be used instead of sythesizing it again.
- tbd_ros_msgs (https://github.com/CMU-TBD/tbd_ros_msgs)
- sound_play (http://wiki.ros.org/sound_play)
- IF uses
tbd_audio_common
play type:- tbd_ros_msgs (https://github.com/CMU-TBD/tbd_ros_msgs)
- tbd_audio_common (https://github.com/CMU-TBD/tbd_audio_common)
- boto3
- Make sure you have a AWS credentials file setup on the system. Guide by AWS. Make sure the account has AWS Polly Speech Enabled
- launch the backend services
roslaunch tbd_polly_speech polly_speech.launch
- You can access the service either through the Python API
from succes_polly_speech import PollySpeech
ps = PollySpeech()
ps.speak("I am a good robot",voice_id='Joanna')
ps.speak("I am not a scary robot",voice_id='Joanna', block=False)
ps.wait()
ps.speak('Hello World. I will be interrupted',voice_id='Emma', block=False, cancel=True)
ps.stopAll() #Interrupts the sentence and stop the voice command
OR directly calling the action server at the topic tbd_polly_speech/speak
with the action pollySpeechAction
.
There are three ROS parameters in the launch file
-
no_audio
, true if you just want to simulate it and not actually running the code. -
play_type
, the default issound_play
in theros-driver/audio_common
repository. You can install this withsudo apt install ros-melodic-audio-common
. The alternative is TBD's lab own audio stack (tbd_audio_common
) that uses actionlib instead of ROS messages and plays faster. -
polly_audio_storage_path
, the path to the location you want to store the audio and also themasterlist.txt
which stores the coding from phrases/text to filename. the default isPACKAGE_ROOT/audio_storage
A list of voice ID can be found here: https://docs.aws.amazon.com/polly/latest/dg/voicelist.html
- Joe Connolly - 07/2018