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 cd813a5 commit 378a018Copy full SHA for 378a018
voice.py
@@ -0,0 +1,14 @@
1
+from gtts import gTTS
2
+import os
3
+
4
+# Define the text you want to convert to speech
5
+text = "Hello! This is a sample text to convert to speech."
6
7
+# Create a gTTS object
8
+tts = gTTS(text=text, lang='en')
9
10
+# Save the audio file
11
+tts.save("output.mp3")
12
13
+# Play the audio file
14
+os.system("start output.mp3")
0 commit comments