Skip to content

code-glitchers/SpeechStylis

Repository files navigation

πŸŒπŸ€– SpeechStylis AI: The Cutting-Edge in Text-to-Speech Synthesis with Python! πŸš€πŸ”Š

Hey there, tech enthusiasts! πŸ‘‹ Are you tired of boring, robotic text-to-speech voices? 😴 Well, we've got some exciting news for you! πŸŽ‰ We're introducing SpeechStylis AI, the cutting-edge technology that's revolutionizing the world of text-to-speech synthesis with Python! πŸš€

Imagine being able to generate natural-sounding speech from text input, with a tone and style that matches your personality or brand. πŸ’¬ That's exactly what SpeechStylis AI does! It uses advanced machine learning algorithms to analyze a large dataset of human speech recordings, and then generates new speech samples that sound like they were recorded by a real person. 🀯

Ready to give it a try? SpeechStylis AI is now available as a Python library, so you can easily integrate it into your own projects. πŸ› οΈ Whether you're building a virtual assistant, creating an audiobook, or developing an accessibility tool, SpeechStylis AI has everything you need to make your vision a reality. 🏑

Discord Mozilla License Python Version Discord.py library GitHub Issues GitHub Pull Requests GitHub Stars Profile Views

πŸ’¬ 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

πŸš€ Features

  • Pretrained Models: Explore a wide range of pretrained models in over 1100 languages.

  • Versatile Tools: Utilize tools for training new models and fine-tuning existing ones in any language.

  • Dataset Analysis: Leverage utilities for dataset analysis and curation.

Model Implementations

Spectrogram models

Installation

πŸ‘©β€πŸ’»SpeechStylis AI is tested on Ubuntu 18.04 with python >= 3.9, < 3.12.

Tested Platforms:

  • Ubuntu
  • Kali Linux
  • Google Cloud
pip install TTS

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

git clone https://github.com/haydenbanz/SpeechStylis.git

Modify .py File to Specify Pre-recorded Audio Location

To use your prerecorded audio, locate the .py file and find the section where the speaker's WAV file path is defined. Update the speaker_wav_path variable with the path to your audio file. Below is an example:

# Original Code
speaker_wav_path = "/content/drive/MyDrive/audio.wav"

run in google collab

Open In Colab

Synthesizing speech by SpeechStylis AI

Running a multi-speaker and multi-lingual model

import torch
from TTS.api import TTS

# Get device
device = "cuda" if torch.cuda.is_available() else "cpu"

# List available 
print(TTS().list_models())

# Init TTS
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)

# Run TTS
# ❗ Since this model is multi-lingual voice cloning model, we must set the target speaker_wav and language
# Text to speech list of amplitude values as output
wav = tts.tts(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en")
# Text to speech to a file
tts.tts_to_file(text="Hello world!", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav")

Running a single speaker model

# Init TTS with the target model name
tts = TTS(model_name="tts_models/de/thorsten/tacotron2-DDC", progress_bar=False).to(device)

# Run TTS
tts.tts_to_file(text="Ich bin eine Testnachricht.", file_path=OUTPUT_PATH)

# Example voice cloning with YourTTS in English, French and Portuguese
tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False).to(device)
tts.tts_to_file("This is voice cloning.", speaker_wav="my/cloning/audio.wav", language="en", file_path="output.wav")
tts.tts_to_file("C'est le clonage de la voix.", speaker_wav="my/cloning/audio.wav", language="fr-fr", file_path="output.wav")
tts.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

tts = TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24", progress_bar=False).to("cuda")
tts.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

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

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

For Fairseq models, use the following name format: tts_models/<lang-iso_code>/fairseq/vits. You can find the language ISO codes here and learn about the Fairseq models here.

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

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.

If you have any questions or feedback, please contact the project maintainers:

Credits

This project is maintained by:

Contributor Name

Contributors and Developers

Contributor Name Contributor Name

Support

If you find this project helpful, consider buying us a coffee:

Buy Me a Coffee

License

SpeechStylis AI is licensed under the Mozilla License. See the LICENSE file for details.

Python Contributions Welcome

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published