Only released in EOL distros:
The speech_database package performs text-to-speech conversion by using Google's speech synthesiser. It also provides a storage solution for synthesised speech. Speech can be accessed by publishing a text string at the /speech topic. If no entry exists, the text will by synthesised and stored locally in an mp3 file. After an entry that corresponds to the text was found or created, a request to play the audio file is published at the /robotsound topic to be processed by the soundplay_node.py of the sound_play package.
- Maintainer: Alexander Reiter <alexander.reiter AT me DOT com>
- Author: Alexander Reiter <alexander.reiter AT me DOT com>
- License: BSD
- Source: git https://github.com/robinJKU/hmi_robin.git (branch: hydro-devel)
See the speech_database node documentation.
speech_databaseThis node sends request to the soundplay_node to play audio files that contain synthesised speech. It checks with a dictonary if the to-be-synthesised text has been handled before. If so, the existing audio file is used, otherwise, synthesised speech is downloaded from Google. The filename is a 50 character string and is chosen randomly. To determine whether an audio file that corresponds to the text already exists, the node accesses a json dictionary that contains pre-downloaded files with synthesised speech. It holds strings as keys and filenames as values.
Subscribed Topics/speech (std_msgs/String)
- text to be synthesised
Published Topics/robotsound (sound_play/SoundRequest)
- Request message for playing audio files
- path to folder that contains audio files
- Language abbreviation (en, de, fr, etc.) for speech synthesis
- path to json file that holds the speech database
Use roslaunch files to load this files.
speech.launch - Launches soundplay_node.py of the sound_play package and the speech_database node with the parameters mentioned above.
Test Voice Output
rostopic pub /speech std_msgs/String "Hello World"
one can test the voice output.
Use of self generated voice files
It is also possible to use self generated voice files (e.g. by recording the own voice). In this case one has to copy the files into the folder defined by the parameter '~audioPath' and edit the json file defined by '~jsonPath' by simply adding lines for every entry.