GitSummarize

🐸Coqui.ai News

📣 ⓍTTSv2 is here with 16 languages and better performance across the board.

📣 ⓍTTS fine-tuning code is out. Check the example recipes.

📣 ⓍTTS can now stream with <200ms latency.

📣 ⓍTTS, our production TTS model that can speak 13 languages, is released Blog Post, Demo, Docs

📣 🐶Bark is now available for inference with unconstrained voice cloning. Docs

📣 You can use ~1100 Fairseq models with 🐸TTS.

📣 🐸TTS now supports 🐢Tortoise with faster inference. Docs

📣 Voice generation with prompts - Prompt to Voice - is live on Coqui Studio!! - Blog Post

📣 Voice generation with fusion - Voice fusion - is live on Coqui Studio.

📣 Voice cloning is live on Coqui Studio.

🐸TTS is a library for advanced Text-to-Speech generation.

🚀 Pretrained models in +1100 languages.

🛠️ Tools for training new models and fine-tuning existing models in any language.

📚 Utilities for dataset analysis and curation.

______________________________________________________________________

Discord License PyPI version Covenant Downloads DOI GithubActions GithubActions GithubActions GithubActions GithubActions GithubActions GithubActions GithubActions GithubActions GithubActions GithubActions Docs

______________________________________________________________________

💬 Where to ask questions

Please use our dedicated channels for questions and discussion. Help is much more valuable if it's shared publicly so that more people can benefit from it.

| Type | Platforms |

| ------------------------------- | --------------------------------------- |

| 🚨 Bug Reports | [GitHub Issue Tracker] |

| 🎁 Feature Requests & Ideas | [GitHub Issue Tracker] |

| 👩‍💻 Usage Questions | [GitHub Discussions] |

| 🗯 General Discussion | [GitHub Discussions] or [Discord] |

[github issue tracker]: https://github.com/coqui-ai/tts/issues

[github discussions]: https://github.com/coqui-ai/TTS/discussions

[discord]: https://discord.gg/5eXr5seRrv

[Tutorials and Examples]: https://github.com/coqui-ai/TTS/wiki/TTS-Notebooks-and-Tutorials

| Type | Links |

| ------------------------------- | --------------------------------------- |

| 💼 Documentation | ReadTheDocs

| 💾 Installation | TTS/README.md|

| 👩‍💻 Contributing | CONTRIBUTING.md|

| 📌 Road Map | Main Development Plans

| 🚀 Released Models | TTS Releases and Experimental Models|

| 📰 Papers | TTS Papers|

🥇 TTS Performance

Underlined "TTS" and "Judy" are internal 🐸TTS models that are not released open-source. They are here to show the potential. Models prefixed with a dot (.Jofish .Abe and .Janice) are real human voices.

Features

High-performance Deep Learning models for Text2Speech tasks.

Text2Spec models (Tacotron, Tacotron2, Glow-TTS, SpeedySpeech).

Speaker Encoder to compute speaker embeddings efficiently.

Vocoder models (MelGAN, Multiband-MelGAN, GAN-TTS, ParallelWaveGAN, WaveGrad, WaveRNN)

Fast and efficient model training.

Detailed training logs on the terminal and Tensorboard.

Support for Multi-speaker TTS.

Efficient, flexible, lightweight but feature complete Trainer API.

Released and ready-to-use models.

Tools to curate Text2Speech datasets under``dataset_analysis``.

Utilities to use and test your models.

Modular (but not too much) code base enabling easy implementation of new ideas.

Model Implementations

Spectrogram models

Tacotron: paper

Tacotron2: paper

Glow-TTS: paper

Speedy-Speech: paper

Align-TTS: paper

FastPitch: paper

FastSpeech: paper

FastSpeech2: paper

SC-GlowTTS: paper

Capacitron: paper

OverFlow: paper

Neural HMM TTS: paper

Delightful TTS: paper

End-to-End Models

ⓍTTS: blog

VITS: paper

🐸 YourTTS: paper

🐢 Tortoise: orig. repo

🐶 Bark: orig. repo

Attention Methods

Guided Attention: paper

Forward Backward Decoding: paper

Graves Attention: paper

Double Decoder Consistency: blog

Dynamic Convolutional Attention: paper

Alignment Network: paper

Speaker Encoder

GE2E: paper

Angular Loss: paper

Vocoders

MelGAN: paper

MultiBandMelGAN: paper

ParallelWaveGAN: paper

GAN-TTS discriminators: paper

WaveRNN: origin

WaveGrad: paper

HiFiGAN: paper

UnivNet: paper

Voice Conversion

FreeVC: paper

You can also help us implement more models.

Installation

🐸TTS is tested on Ubuntu 18.04 with python >= 3.9, < 3.12..

If you are only interested in synthesizing speech with the released 🐸TTS models, installing from PyPI is the easiest option.

bash
1pip install TTS

If you plan to code or train models, clone 🐸TTS and install it locally.

bash
1git clone https://github.com/coqui-ai/TTS 2pip install -e .[all,dev,notebooks] # Select the relevant extras

If you are on Ubuntu (Debian), you can also run following commands for installation.

bash
1$ make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS. 2$ make install

If you are on Windows, 👑@GuyPaddock wrote installation instructions here.

Docker Image

You can also try TTS without install with the docker image.

Simply run the following command and you will be able to run TTS without installing it.

bash
1docker run --rm -it -p 5002:5002 --entrypoint /bin/bash ghcr.io/coqui-ai/tts-cpu 2python3 TTS/server/server.py --list_models #To get the list of available models 3python3 TTS/server/server.py --model_name tts_models/en/vctk/vits # To start a server

You can then enjoy the TTS server here

More details about the docker images (like GPU support) can be found here

Synthesizing speech by 🐸TTS

🐍 Python API

Running a multi-speaker and multi-lingual model

python
1import torch 2from TTS.api import TTS 3 4# Get device 5device = "cuda" if torch.cuda.is_available() else "cpu" 6 7# List available 🐸TTS models 8print(TTS().list_models()) 9 10# Init TTS 11tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device) 12 13# Run TTS 14# ❗ Since this model is multi-lingual voice cloning model, we must set the target speaker_wav and language 15# Text to speech list of amplitude values as output 16wav = tts.tts(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en") 17# Text to speech to a file 18tts.tts_to_file(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav")

Running a single speaker model

python
1# Init TTS with the target model name 2tts = TTS(model_name="tts_models/de/thorsten/tacotron2-DDC", progress_bar=False).to(device) 3 4# Run TTS 5tts.tts_to_file(text="Ich bin eine Testnachricht.", file_path=OUTPUT_PATH) 6 7# Example voice cloning with YourTTS in English, French and Portuguese 8tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False).to(device) 9tts.tts_to_file("This is voice cloning.", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav") 10tts.tts_to_file("C'est le clonage de la voix.", speaker_wav="my/cloning/audio.wav", language="fr-fr", file_path="output.wav") 11tts.tts_to_file("Isso é clonagem de voz.", speaker_wav="my/cloning/audio.wav", language="pt-br", file_path="output.wav")

Example voice conversion

Converting the voice in source_wav to the voice of target_wav

python
1tts = TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24", progress_bar=False).to("cuda") 2tts.voice_conversion_to_file(source_wav="my/source.wav", target_wav="my/target.wav", file_path="output.wav")

Example voice cloning together with the voice conversion model.

This way, you can clone voices by using any model in 🐸TTS.

python
1tts = TTS("tts_models/de/thorsten/tacotron2-DDC") 2tts.tts_with_vc_to_file( 3 "Wie sage ich auf Italienisch, dass ich dich liebe?", 4 speaker_wav="target/speaker.wav", 5 file_path="output.wav" 6)

Example text to speech using Fairseq models in ~1100 languages 🤯.

For Fairseq models, use the following name format: tts_models//fairseq/vits.

You can find the language ISO codes here

and learn about the Fairseq models here.

python
1# TTS with on the fly voice conversion 2api = TTS("tts_models/deu/fairseq/vits") 3api.tts_with_vc_to_file( 4 "Wie sage ich auf Italienisch, dass ich dich liebe?", 5 speaker_wav="target/speaker.wav", 6 file_path="output.wav" 7)

Command-line tts

Synthesize speech on command line.

You can either use your trained model or choose a model from the provided list.

If you don't specify any models, then it uses LJSpeech based English model.

Single Speaker Models

List provided models:

text
1$ tts --list_models

Get model info (for both tts_models and vocoder_models):

Query by type/name:

The model_info_by_name uses the name as it from the --list_models.

text
1$ tts --model_info_by_name "<model_type>/<language>/<dataset>/<model_name>"

For example:

text
1$ tts --model_info_by_name tts_models/tr/common-voice/glow-tts 2 $ tts --model_info_by_name vocoder_models/en/ljspeech/hifigan_v2

Query by type/idx:

The model_query_idx uses the corresponding idx from --list_models.

text
1$ tts --model_info_by_idx "<model_type>/<model_query_idx>"

For example:

text
1$ tts --model_info_by_idx tts_models/3

Query info for model info by full name:

text
1$ tts --model_info_by_name "<model_type>/<language>/<dataset>/<model_name>"

Run TTS with default models:

text
1$ tts --text "Text for TTS" --out_path output/path/speech.wav

Run TTS and pipe out the generated TTS wav file data:

text
1$ tts --text "Text for TTS" --pipe_out --out_path output/path/speech.wav | aplay

Run a TTS model with its default vocoder model:

text
1$ tts --text "Text for TTS" --model_name "<model_type>/<language>/<dataset>/<model_name>" --out_path output/path/speech.wav

For example:

text
1$ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --out_path output/path/speech.wav

Run with specific TTS and vocoder models from the list:

text
1$ tts --text "Text for TTS" --model_name "<model_type>/<language>/<dataset>/<model_name>" --vocoder_name "<model_type>/<language>/<dataset>/<model_name>" --out_path output/path/speech.wav

For example:

text
1$ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --vocoder_name "vocoder_models/en/ljspeech/univnet" --out_path output/path/speech.wav

Run your own TTS model (Using Griffin-Lim Vocoder):

text
1$ tts --text "Text for TTS" --model_path path/to/model.pth --config_path path/to/config.json --out_path output/path/speech.wav

Run your own TTS and Vocoder models:

text
1$ tts --text "Text for TTS" --model_path path/to/model.pth --config_path path/to/config.json --out_path output/path/speech.wav 2 --vocoder_path path/to/vocoder.pth --vocoder_config_path path/to/vocoder_config.json

Multi-speaker Models

List the available speakers and choose a among them:

text
1$ tts --model_name "<language>/<dataset>/<model_name>" --list_speaker_idxs

Run the multi-speaker TTS model with the target speaker ID:

text
1$ tts --text "Text for TTS." --out_path output/path/speech.wav --model_name "<language>/<dataset>/<model_name>" --speaker_idx <speaker_id>

Run your own multi-speaker TTS model:

text
1$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/model.pth --config_path path/to/config.json --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>

Voice Conversion Models

text
1$ tts --out_path output/path/speech.wav --model_name "<language>/<dataset>/<model_name>" --source_wav <path/to/speaker/wav> --target_wav <path/to/reference/wav>

Directory Structure

text
1|- notebooks/ (Jupyter Notebooks for model evaluation, parameter selection and data analysis.) 2|- utils/ (common utilities.) 3|- TTS 4 |- bin/ (folder for all the executables.) 5 |- train*.py (train your target model.) 6 |- ... 7 |- tts/ (text to speech models) 8 |- layers/ (model layer definitions) 9 |- models/ (model definitions) 10 |- utils/ (model specific utilities.) 11 |- speaker_encoder/ (Speaker Encoder models.) 12 |- (same) 13 |- vocoder/ (Vocoder models.) 14 |- (same)