📣 Clone your voice with a single click on 🐸Coqui.ai
🐸TTS is a library for advanced Text-to-Speech generation. It's built on the latest research, was designed to achieve the best trade-off among ease-of-training, speed and quality.
🐸TTS comes with pretrained models, tools for measuring dataset quality and already used in 20+ languages for products and research projects.
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.
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$ makeinstall
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 models3python3 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
python
1from TTS.api import TTS
23# Running a multi-speaker and multi-lingual model45# List available 🐸TTS models and choose the first one6model_name = TTS.list_models()[0]7# Init TTS8tts = TTS(model_name)9# Run TTS10# ❗ Since this model is multi-speaker and multi-lingual, we must set the target speaker and the language11# Text to speech with a numpy output12wav = tts.tts("This is a test! This is also a test!!", speaker=tts.speakers[0], language=tts.languages[0])13# Text to speech to a file14tts.tts_to_file(text="Hello world!", speaker=tts.speakers[0], language=tts.languages[0], file_path="output.wav")1516# Running a single speaker model1718# Init TTS with the target model name19tts = TTS(model_name="tts_models/de/thorsten/tacotron2-DDC", progress_bar=False, gpu=False)20# Run TTS21tts.tts_to_file(text="Ich bin eine Testnachricht.", file_path=OUTPUT_PATH)2223# Example voice cloning with YourTTS in English, French and Portuguese:24tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False, gpu=True)25tts.tts_to_file("This is voice cloning.", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav")26tts.tts_to_file("C'est le clonage de la voix.", speaker_wav="my/cloning/audio.wav", language="fr-fr", file_path="output.wav")27tts.tts_to_file("Isso é clonagem de voz.", speaker_wav="my/cloning/audio.wav", language="pt-br", file_path="output.wav")282930# Example voice conversion converting speaker of the `source_wav` to the speaker of the `target_wav`3132tts = TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24", progress_bar=False, gpu=True)33tts.voice_conversion_to_file(source_wav="my/source.wav", target_wav="my/target.wav", file_path="output.wav")3435# Example voice cloning by a single speaker TTS model combining with the voice conversion model. This way, you can36# clone voices by using any model in 🐸TTS.3738tts = TTS("tts_models/de/thorsten/tacotron2-DDC")39tts.tts_with_vc_to_file(40"Wie sage ich auf Italienisch, dass ich dich liebe?",41 speaker_wav="target/speaker.wav",42 file_path="ouptut.wav"43)4445# Example text to speech using [🐸Coqui Studio](https://coqui.ai) models. You can use all of your available speakers in the studio.46# [🐸Coqui Studio](https://coqui.ai) API token is required. You can get it from the [account page](https://coqui.ai/account).47# You should set the `COQUI_STUDIO_TOKEN` environment variable to use the API token.4849# If you have a valid API token set you will see the studio speakers as separate models in the list.50# The name format is coqui_studio/en/<studio_speaker_name>/coqui_studio51models = TTS().list_models()52# Init TTS with the target studio speaker53tts = TTS(model_name="coqui_studio/en/Torcull Diarmuid/coqui_studio", progress_bar=False, gpu=False)54# Run TTS55tts.tts_to_file(text="This is a test.", file_path=OUTPUT_PATH)56# Run TTS with emotion and speed control57tts.tts_to_file(text="This is a test.", file_path=OUTPUT_PATH, emotion="Happy", speed=1.5)
Command line tts
Single Speaker Models
List provided models:
$ 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.