Antud juhend on loodud EKI kõnesüntesaatori kasutamiseks ROSis, kasutades Tartu Ülikooli Robootika projekti raames loodud ROSi wrapperit ja soundplay paketti. Wrapper on loodud töötama ROS Kinetic Kame versioonil.
Juhend kasutamiseks:
- Klooni EstROSi kaust https://github.com/ut-ims-robotics/EstROS oma catkin lähtekoodi kausta.
cd catkin_ws/src
git clone https://github.com/ut-ims-robotics/est_voice_synth.git
- Muuda .wav failide loomise asukohta oma failisüsteemis, tuleb anda absoluutne failitee. Selleks muuda src kaustas olevas
estonian_text2speech.cpp
failis parameetreid:
size_t seconds = ess->convertTextToWave (text, "/abs_path_to_gen_wav/est_synth.wav");
sc->playWaveFromPkg("sound_play", "/abs_path_to_gen_wav/est_synth.wav");
- Klooni synthts_et-master koodihoidla Githubist kusagile oma arvutisse.
cd ~
git clone https://github.com/ut-ims-robotics/synthts_et-master.git
-
Kopeeri kloonitud synthts_et-master koodihoidlast kaust nimega dct oma catkin tööruumi peakausta (catkin_ws)
-
Installeeri Audio common ROS pakett.
sudo apt-get install ros-<distro>-audio-common
- Mine oma catkin tööruumi peakausta ja käivita catkin_make käsk:
cd catkin_ws
catkin_make
- Programmi saab testida jooksutades käsku
roslaunch
. Kui see ei tööta proovi sõlmi individuaalset käivitada kasutadesrosrun
käsku.
source devel/setup.bash
roslaunch est_voice_synth est_voice_synth.launch
- Nüüd ootab sõlm nimega
estonian_text2speech
teema all nimega/estonian_voice
sõne, mida.wav
failiks sünteesida. Kõige kiiremini saab testida sõlme korrektset tööd väljastades vastavale teemale sõne ning kuulata valminud.wav
faili.
rostopic pub /estonian_voice "Sünteesi jutumärkides olev tekst"
- (VALIKULINE) Kui soovid jooksutada pikemaid
.wav
faile kui 10 sekundit, siis tuleks kõrvaldada üks levinud probleemsoundplay_node.py
failis. See peaks asuma asukohas/opt/ros/kinetic/lib/sound_play/soundplay_node.py
, kuid selle leidmiseks võib ka kasutada käskusudo find / -name soundplay_node.py
def get_staleness(self):
.....
position = self.sound.query_position(Gst.Format.TIME)[1] # Muuda siin 0 üheks nagu näidatud
duration = self.sound.query_duration(Gst.Format.TIME)[1] # Muuda siin 0 üheks nagu näidatud
......
This installation guide is meant to help you use the EKI speech synthesizer on the ROS operation system using the soundplay package. It was created during the course called Robotics Engineering Project in University of Tartu. The current wrapper is designed to work on ROS Kinetic Kame.
Installation guide:
- Clone the EstROS folder https://github.com/ut-ims-robotics/EstROS into your catkins_ws src folder.
cd catkin_ws/src
git clone https://github.com/ut-ims-robotics/est_voice_synth.git
- Change the location for the generated .wav files according to your file system, you need to give the absolute path. You need to change some parameters in the
estonian_text2speech.cpp
file in located your src folder:
size_t seconds = ess->convertTextToWave (text, "/abs_path_to_gen_wav/est_synth.wav");
sc->playWaveFromPkg("sound_play", "/abs_path_to_gen_wav/est_synth.wav");
- Clone synthts_et-master repository from Githubist to somewhere in your computer.
cd ~
git clone https://github.com/ut-ims-robotics/synthts_et-master.git
-
Copy a folder called
dct
from the cloned synthts_et-master repository into your workspace's main folder (catkin_ws) -
Install the Audio common ROS package.
sudo apt-get install ros-<distro>-audio-common
- Got to your catkin_ws folder and execute the catkin_make command:
cd catkin_ws
catkin_make
- You can test the program using the
roslaunch
command. If that doesn't you can try running each node individually using therosrun
command.
source devel/setup.bash
roslaunch est_voice_synth est_voice_synth.launch
- The
estonian_text2speech
node is now waiting for string data under the/estonian_voice
topic and generates a.wav
accordingly. The easiest way to check if everything is working properly is to manually publsih a string to that topic and listen to the generated.wav
file.
rostopic pub /estonian_voice "turn this string into sound"
- (OPTIONAL) If you wish to play a
.wav
that is longer than 10 seconds then you need fix a common bug within thesoundplay_node.py
file. The node should be located in at/opt/ros/kinetic/lib/sound_play/soundplay_node.py
However you can also use the following command to find itsudo find / -name soundplay_node.py
def get_staleness(self):
.....
position = self.sound.query_position(Gst.Format.TIME)[1] # Chnage this from 0 to 1
duration = self.sound.query_duration(Gst.Format.TIME)[1] # Chnage this from 0 to 1
......