Whisper-TikTok-Demo / src /text_to_speech.py
MatteoFasulo's picture
Added src folder
cf72e88
raw
history blame contribute delete
290 Bytes
import edge_tts
async def tts(final_text: str, voice: str = "en-US-ChristopherNeural", stdout: bool = False, outfile: str = "tts.mp3", args=None) -> bool:
communicate = edge_tts.Communicate(final_text, voice)
if not stdout:
await communicate.save(outfile)
return True