TTS_CLI is a text-to-speech (TTS) script that allows you to convert text into spoken words using various TTS engines.
- Clone the repository:
git clone https://github.com/juanmirod/tts.git- Navigate to the project directory:
cd tts- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate- Install the required dependencies:
pip install -r requirements.txt- Add your API keys to the .env file:
cp .env.sample .env
# open .env file and add your keystts is a command line command, you can run -h for help:
python -m tts.tts -hRun it with the sample txt file and the default voice in OpenAI tts API:
python -m tts.tts sample.txtRun it with google tts (free):
python -m tts.tts -g sample.txtList available HuggingFace TTS models:
python -m tts.tts --list-hf-modelsExample output:
Fetching top 20 HuggingFace TTS models...
Model ID | Downloads | Likes
---------------------------------------------------------------------
espnet/eng_male_fgl | 123456 | 987
facebook/mms-tts-eng | 234567 | 876
...
Found 20 model(s).
Search for HuggingFace TTS models by keyword:
python -m tts.tts --search-hf-models hindiExample output:
Searching for HuggingFace TTS models matching 'hindi'...
Model ID | Downloads | Likes
--------------------------------------------------------------------
espnet/hindi_male_fgl | 54321 | 432
...
Found 3 model(s).
Use a HuggingFace TTS model:
python -m tts.tts -hf --hf-model espnet/eng_male_fgl sample.txtContributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.