Update app.py
Browse files
app.py
CHANGED
@@ -192,12 +192,12 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
192 |
|
193 |
|
194 |
|
195 |
-
def generate_audio():
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
|
202 |
st.session_state['reference'] = '/home/user/app/pdf2image/default_output.png'
|
203 |
st.session_state['audio'] = ''
|
@@ -232,10 +232,10 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
232 |
#write(stream_example)
|
233 |
message_placeholder.markdown(result['result'])
|
234 |
|
235 |
-
sound_file = BytesIO()
|
236 |
-
tts = gTTS(result['result'], lang='en')
|
237 |
-
tts.write_to_fp(sound_file)
|
238 |
-
st.audio(sound_file)
|
239 |
|
240 |
if "reference" not in st.session_state:
|
241 |
st.session_state.reference = False
|
|
|
192 |
|
193 |
|
194 |
|
195 |
+
# def generate_audio():
|
196 |
+
# with open('/home/user/app/audio/audio.mp3','wb') as sound_file:
|
197 |
+
# tts = gTTS(result['result'], lang='en', tld='co.in')
|
198 |
+
# tts.write_to_fp(sound_file)
|
199 |
+
# sound = AudioSegment.from_mp3("/home/user/app/audio/audio.mp3")
|
200 |
+
# sound.export("/home/user/app/audio/audio.wav", format="wav")
|
201 |
|
202 |
st.session_state['reference'] = '/home/user/app/pdf2image/default_output.png'
|
203 |
st.session_state['audio'] = ''
|
|
|
232 |
#write(stream_example)
|
233 |
message_placeholder.markdown(result['result'])
|
234 |
|
235 |
+
# sound_file = BytesIO()
|
236 |
+
# tts = gTTS(result['result'], lang='en')
|
237 |
+
# tts.write_to_fp(sound_file)
|
238 |
+
# st.audio(sound_file)
|
239 |
|
240 |
if "reference" not in st.session_state:
|
241 |
st.session_state.reference = False
|