This commit is contained in:
rany
2021-06-05 17:29:16 +03:00
parent 76f421d688
commit 91f62a84d8
9 changed files with 209 additions and 167 deletions

19
example/input_example.py Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python3
# Example Python script that shows how to use edge-tts as a module
import asyncio
import edgeTTS
import time
import tempfile
from playsound import playsound
async def main():
ask = input("What do you want TTS to say? ")
with tempfile.NamedTemporaryFile() as fp:
async for i in edgeTTS.run_tts(edgeTTS.mkssmlmsg(ask)): # default Aria, audio-24khz-48kbitrate-mono-mp3, etc..
fp.write(i)
playsound(fp.name)
if __name__ == "__main__":
asyncio.run(main())