Closed KonerDev closed 11 months ago
You need asyncio but you could use it just fine if your application does not make use of async, for example:
import asyncio
import edge_tts as et
def et_save_to_file(text, *, voice="en-GB-SoniaNeural", file="test.mp3"):
async def wrapper():
c = et.Communicate(text, voice)
await c.save(file)
loop = asyncio.get_event_loop_policy().get_event_loop()
try:
loop.run_until_complete(wrapper())
finally:
loop.close()
if __name__ == "__main__":
et_save_to_file("Hey, this is a test!")
This way you won't need to change your style at all and could use it as though it wasn't asyncio
Can you use edge-tts without asyncio?