Spaces:
Sleeping
Sleeping
parvezalmuqtadir
commited on
Commit
•
126529d
1
Parent(s):
a1e494d
Update app.py
Browse files
app.py
CHANGED
@@ -89,12 +89,11 @@ def render_file(file):
|
|
89 |
image = Image.frombytes('RGB', [pix.width, pix.height], pix.samples)
|
90 |
return image
|
91 |
|
92 |
-
|
93 |
-
|
94 |
def generate_speech(text):
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
|
99 |
def play_sound(file_path):
|
100 |
try:
|
|
|
89 |
image = Image.frombytes('RGB', [pix.width, pix.height], pix.samples)
|
90 |
return image
|
91 |
|
92 |
+
# Function to generate speech from text
|
|
|
93 |
def generate_speech(text):
|
94 |
+
tts = gTTS(text=text, lang='en')
|
95 |
+
tts.save("output.mp3")
|
96 |
+
play_sound("output.mp3")
|
97 |
|
98 |
def play_sound(file_path):
|
99 |
try:
|