SadTalker / src /utils /text2speech.py
vinthony's picture
fixed req
a86a2b8
raw
history blame
272 Bytes
import os
def text2speech(txt, audio_path):
print(txt)
cmd = f'tts --text "{txt}" --out_path {audio_path}'
print(cmd)
try:
os.system(cmd)
return audio_path
except:
print("Error: Failed convert txt to audio")
return None