1!pip install TTS
2!sudo apt-get -y install espeak-ng
1!tts --text "زندگی فقط یک بار است؛ از آن به خوبی استفاده کن" \
2 --model_path "/coqui_training/run-July-31-2022_10+54AM-0000000/checkpoint_24000.pth" \
3 --config_path "/coqui_training/run-July-31-2022_10+54AM-0000000/config.json" \
4 --out_path "speech1.wav"
1
2from TTS.config import load_config
3from TTS.utils.manage import ModelManager
4from TTS.utils.synthesizer import Synthesizer
5
6basepath="/train_output/run-December-24-2022_09+28AM-0000000"
7config=basepath+"/config.json"
8model=basepath+"/best_model.pth"
9
10model_path =model # Absolute path to the model checkpoint.pth
11config_path =config # Absolute path to the model config.json
12
13text=".زندگی فقط یک بار است؛ از آن به خوبی استفاده کن"
14
15synthesizer = Synthesizer(
16 model_path, config_path
17)
18wavs = synthesizer.tts(text)
19synthesizer.save_wav(wavs, 'sp.wav')
1import IPython
2IPython.display.Audio('sp.wav')