AutoDub / utils /tts.py
arm-inas's picture
Create tts.py
5a6a4e3 verified
Raw History Blame Contribute Delete
300 Bytes
from TTS.api import TTS
# Tek ses modeli örneği
tts = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC", progress_bar=False, gpu=False)
def synthesize_speech(text, lang="en"):
tts_file_path = "/tmp/out.wav"
tts.tts_to_file(text=text, file_path=tts_file_path)
return tts_file_path