varl42 commited on
Commit
c3c915d
·
1 Parent(s): 003f78c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- preload_models()
79
- tts = generate_audio(summary)
80
- return (SAMPLE_RATE, tts)
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