-
-
Save frederikstroem/c6b3d40abd9124dddecadbce4ada65ca to your computer and use it in GitHub Desktop.
Cogai TTS using docker & script placed at ~/.local/bin/tts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Test: `echo "This should be read up for me" | tts` | |
# Read all input into variable and replace newlines with spaces | |
input=$(cat | tr '\n' ' ') | |
# Save current time in ISO8601 format and replace special characters with underscore | |
timestamp=$(date -u +"%Y_%m_%dT%H_%M_%SZ") | |
# Run the Docker command with CPU version | |
# https://github.com/coqui-ai/TTS/discussions/1891 | |
vits_speaker_idx="p234" # Pretty smooth British male voice. | |
docker run --rm -v ~/tts-output:/root/tts-output \ | |
ghcr.io/coqui-ai/tts-cpu \ | |
--out_path "/root/tts-output/$timestamp.wav" \ | |
--model_name "tts_models/en/vctk/vits" \ | |
--speaker_idx "$vits_speaker_idx" \ | |
--text "$input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment