No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.
Repository Summary
Description | Text-to-Speech for ROS 2 |
Checkout URI | https://github.com/mgonzs13/tts_ros.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-03-17 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | text-to-speech tts ros2 |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
tts_bringup | 2.6.0 |
tts_ros | 2.6.0 |
README
tts_ros
This repositiory integrates the Python TTS (Text-to-Speech) package into ROS 2 using audio_common 4.0.4.
| ROS 2 Distro | Branch | Build status | Docker Image | Documentation |
| :----------: | :-----------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Humble** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [](https://github.com/mgonzs13/tts_ros/actions/workflows/humble-docker-build.yml?branch=main) | [](https://hub.docker.com/r/mgons/tts_ros/tags?name=humble) | [](https://mgonzs13.github.io/tts_ros/) |
| **Iron** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [](https://github.com/mgonzs13/tts_ros/actions/workflows/iron-docker-build.yml?branch=main) | [](https://hub.docker.com/r/mgons/tts_ros/tags?name=iron) | [](https://mgonzs13.github.io/tts_ros/) |
| **Jazzy** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [](https://github.com/mgonzs13/tts_ros/actions/workflows/jazzy-docker-build.yml?branch=main) | [](https://hub.docker.com/r/mgons/tts_ros/tags?name=jazzy) | [](https://mgonzs13.github.io/tts_ros/) |
| **Rolling** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [](https://github.com/mgonzs13/tts_ros/actions/workflows/rolling-docker-build.yml?branch=main) | [](https://hub.docker.com/r/mgons/tts_ros/tags?name=rolling) | [](https://mgonzs13.github.io/tts_ros/) |
Table of Contents
Installation
cd ~/ros2_ws/src
git clone https://github.com/mgonzs13/audio_common.git
git clone https://github.com/mgonzs13/tts_ros.git
pip3 install -r tts_ros/requirements.txt
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build
Docker
You can build the tts_ros docker:
docker build -t tts_ros .
Then, you can run the docker container:
docker run -it --rm --device /dev/snd tts_ros
Usage
To use this tool you have to run the tts_node. It has the following parameters:
-
chunk
: Size of audio chunks to be sent to the audio player. -
frame_id
: Frame of for the tts. -
model
: The tts model. You can check the available models withtts --list_models
. -
model_path
: Path to a local model file. -
config_path
: Path to a config file. -
vocoder_path
: Path to a vocoder model file. -
vocoder_config_path
: Path to a config file. -
device
: The device to run the model same as in torch. -
speaker_wav
: The wav file to perform voice cloning. -
speaker
: Which speaker voice to use for multi-speaker models. Check withtts --model_name <model> --list_language_idx
. -
stream
: Whether to stream the audio data.
Parameters Format
ros2 run tts_ros tts_node --ros-args -p chunk:=4096 -p frame_id:="your-frame" -p model:="your-model" -p device:="cpu/cuda" -p speaker_wav:="/path/to/wav/file" -p stream:=False
Demo
ros2 launch tts_bringup tts.launch.py device:="cuda"
ros2 action send_goal /say audio_common_msgs/action/TTS "{'text': 'Hello World'}"
Streaming Demo
ros2 launch tts_bringup tts.launch.py stream:=True model:="tts_models/multilingual/multi-dataset/xtts_v2" speaker_wav:="/home/miguel/Downloads/question_1.wav" device:="cuda"
ros2 action send_goal /say audio_common_msgs/action/TTS "{'text': 'Hello World, How are you? Can you hear me? What is your favorite color? Do you know the Robot Operating System?'}"
CONTRIBUTING
No CONTRIBUTING.md found.
No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.