Fix some bugs

This commit is contained in:
rany
2021-06-09 14:16:51 +03:00
parent 5c1f8b8355
commit 7ced20885c
3 changed files with 26 additions and 20 deletions

View File

@@ -6,13 +6,13 @@ import edgeTTS
from playsound import playsound
async def main():
communicate = edgeTTS.Communicate()
ask = input("What do you want TTS to say? ")
with tempfile.NamedTemporaryFile() as fp:
async for i in communicate.run(ask):
if i[2] is not None:
fp.write(i[2])
playsound(fp.name)
communicate = edgeTTS.Communicate()
ask = input("What do you want TTS to say? ")
with tempfile.NamedTemporaryFile() as fp:
async for i in communicate.run(ask):
if i[2] is not None:
fp.write(i[2])
playsound(fp.name)
if __name__ == "__main__":
asyncio.run(main())
asyncio.run(main())