Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +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 |
-
|
72 |
def text_to_audio(text):
|
73 |
#tts = gTTS(text, lang='en')
|
74 |
#buffer = BytesIO()
|
@@ -76,8 +76,8 @@ def text_to_audio(text):
|
|
76 |
#buffer.seek(0)
|
77 |
#return buffer.read()
|
78 |
#######################
|
79 |
-
|
80 |
-
speech_array = generate_audio(
|
81 |
return (SAMPLE_RATE, speech_array)
|
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 |
+
|
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 |
+
preload_models()
|
80 |
+
speech_array = generate_audio(text)
|
81 |
return (SAMPLE_RATE, speech_array)
|
82 |
|
83 |
|