tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2 tts_bringup tts_ros

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.

License: MIT GitHub release Code Size Last Commit GitHub issues GitHub pull requests Contributors Python Formatter Check

| ROS 2 Distro | Branch | Build status | Docker Image | Documentation | | :----------: | :-----------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | **Humble** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [![Humble Build](https://github.com/mgonzs13/tts_ros/actions/workflows/humble-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/tts_ros/actions/workflows/humble-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-humble-blue)](https://hub.docker.com/r/mgons/tts_ros/tags?name=humble) | [![Doxygen Deployment](https://github.com/mgonzs13/tts_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/tts_ros/) | | **Iron** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [![Iron Build](https://github.com/mgonzs13/tts_ros/actions/workflows/iron-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/tts_ros/actions/workflows/iron-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-iron-blue)](https://hub.docker.com/r/mgons/tts_ros/tags?name=iron) | [![Doxygen Deployment](https://github.com/mgonzs13/tts_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/tts_ros/) | | **Jazzy** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [![Jazzy Build](https://github.com/mgonzs13/tts_ros/actions/workflows/jazzy-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/tts_ros/actions/workflows/jazzy-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-jazzy-blue)](https://hub.docker.com/r/mgons/tts_ros/tags?name=jazzy) | [![Doxygen Deployment](https://github.com/mgonzs13/tts_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/tts_ros/) | | **Rolling** | [`main`](https://github.com/mgonzs13/tts_ros/tree/main) | [![Rolling Build](https://github.com/mgonzs13/tts_ros/actions/workflows/rolling-docker-build.yml/badge.svg?branch=main)](https://github.com/mgonzs13/tts_ros/actions/workflows/rolling-docker-build.yml?branch=main) | [![Docker Image](https://img.shields.io/badge/Docker%20Image%20-rolling-blue)](https://hub.docker.com/r/mgons/tts_ros/tags?name=rolling) | [![Doxygen Deployment](https://github.com/mgonzs13/tts_ros/actions/workflows/doxygen-deployment.yml/badge.svg)](https://mgonzs13.github.io/tts_ros/) |

Table of Contents

  1. Installation
  2. Docker
  3. Usage

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 with tts --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 with tts --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.

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2

tts_ros repository

text-to-speech tts ros2