- Python >= 3.9
- Clone git repository in your project root directory
git clone https://github.com/okpyjs/TransformerTTS.git
- Install espeak as phonemizer backend
sudo apt-get install
- Install virtual environment
virtualenv venv
source venv/bin/activate
- Install dependencies
pip install -r TransformerTTS/requirements.txt
- Add following code to your script
import sys
sys.path.append('TransformerTTS/')
from data.audio import Audio
from model.factory import tts_ljspeech
model = tts_ljspeech()
audio = Audio.from_config(model.config)
out = model.predict('Please, say something.')
# Convert spectrogram to wav (with griffin lim)
wav = audio.reconstruct_waveform(out['mel'].numpy().T)
cd TransformerTTS
python predict_tts.py -t "Please, say something."