-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (31 loc) · 872 Bytes
/
main.py
File metadata and controls
36 lines (31 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from gtts import gTTS
import os
from colored import fg
import ctypes
from time import sleep
ctypes.windll.kernel32.SetConsoleTitleW("Text To Speech - By Kqcy")
msg = input(f"Message -\n{fg(204)}> {fg(15)}")
lang = "en"
os.system("cls")
print(f"{fg(204)}> {fg(15)}Creating file{fg(15)}")
sleep(.4)
os.system("cls")
print(f"{fg(204)}> {fg(15)}Creating file.{fg(15)}")
sleep(.4)
os.system("cls")
print(f"{fg(204)}> {fg(15)}Creating file..{fg(15)}")
sleep(.4)
os.system("cls")
print(f"{fg(204)}> {fg(15)}Creating file...{fg(15)}")
sleep(.4)
und = msg.replace(" ", "_")
tts = gTTS(text=msg, lang=lang, slow=False)
tts.save(f"{und}.mp3")
os.system("cls")
sleep(.4)
print(f"{fg(204)}> {fg(15)}Saved file under {fg(204)}{und}.mp3{fg(15)}")
sleep(0.7)
os.system("cls")
input(f"{fg(204)}> {fg(15)}Press enter to exit")
os.system("cls")
exit()