Update app.py
Browse files
app.py
CHANGED
|
@@ -68,6 +68,7 @@ def summarize_text(text):
|
|
| 68 |
|
| 69 |
# Function to convert text to audio
|
| 70 |
# Defines a function to convert text to an audio file using Google Text-to-Speech
|
|
|
|
| 71 |
def text_to_audio(text):
|
| 72 |
#tts = gTTS(text, lang='en')
|
| 73 |
#buffer = BytesIO()
|
|
@@ -75,9 +76,9 @@ def text_to_audio(text):
|
|
| 75 |
#buffer.seek(0)
|
| 76 |
#return buffer.read()
|
| 77 |
#######################
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
return (SAMPLE_RATE,
|
| 81 |
|
| 82 |
|
| 83 |
|
|
|
|
| 68 |
|
| 69 |
# Function to convert text to audio
|
| 70 |
# Defines a function to convert text to an audio file using Google Text-to-Speech
|
| 71 |
+
preload_models()
|
| 72 |
def text_to_audio(text):
|
| 73 |
#tts = gTTS(text, lang='en')
|
| 74 |
#buffer = BytesIO()
|
|
|
|
| 76 |
#buffer.seek(0)
|
| 77 |
#return buffer.read()
|
| 78 |
#######################
|
| 79 |
+
|
| 80 |
+
speech_array = generate_audio(summary)
|
| 81 |
+
return (SAMPLE_RATE, speech_array)
|
| 82 |
|
| 83 |
|
| 84 |
|