We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffd6c3c commit f02b582Copy full SHA for f02b582
voice.py
@@ -5,15 +5,15 @@
5
# Define the text you want to convert to speech
6
text = "Hello! This is a sample text to convert to speech."
7
8
-# Exception Handaled
+# Exception Handaled.
9
try:
10
# Create a gTTS object
11
tts = gTTS(text=text, lang="en")
12
13
- # Save the audio file
+ # Save the audio file in mp3 format
14
tts.save("output.mp3")
15
16
- # Play the audio file
+ # Play the audio file from system
17
os.system("start output.mp3")
18
except Exception as e:
19
print(Fore.RED, e, Fore.RESET)
0 commit comments