SadTalker / modules /text2speech.py
yablokoff's picture
Duplicate from vinthony/SadTalker
f368cb7
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