This is a fork for easy use of VITS Text-To-Speech on Python.
- Clone this repository into the project folder (or $PYTHONPATH)
git clone https://github.com/DDadeA/moegoe_tts.git
cd moegoe_tts
pip install -r requirements.txt
- Download TTS Model
This Korean model will be used in this example.
- Import the module.
# Load lib
from moegoe_tts import MoeGoeTTS
# Load tts model
model = MoeGoeTTS('model/1164_epochs.pth',
'model/config.json')
# Generate wav file
text = '이것은 테스트 문장입니다.'
model.wav(text)
# Change the speaker and the path
print(model.speakers) ## print list of speakers
model.wav(text=text, speaker_id=4, filepath='./demo.wav')
# Get the data as array format
data = model.main(text, 2) # Numpy array
## Play it directly
import simpleaudio as sa
sampling_rate = model.hps_ms.data.sampling_rate
sa_obj = sa.play_buffer(data, 1, 4, sampling_rate)
sa_obj.wait_done()