Update app.py
Browse files
app.py
CHANGED
@@ -251,13 +251,13 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
251 |
st.image(st.session_state['reference'])
|
252 |
if button('TTS'):
|
253 |
with st.sidebar:
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
|
262 |
|
263 |
|
|
|
251 |
st.image(st.session_state['reference'])
|
252 |
if button('TTS'):
|
253 |
with st.sidebar:
|
254 |
+
with open('/home/user/app/audio/audio.mp3','wb') as sound_file:
|
255 |
+
tts = gTTS(result['result'], lang='en', tld = 'co.in')
|
256 |
+
tts.write_to_fp(sound_file)
|
257 |
+
sound = AudioSegment.from_mp3("/home/user/app/audio/audio.mp3")
|
258 |
+
sound.export("/home/user/app/audio/audio.wav", format="wav")
|
259 |
+
st.session_state['audio'] = '/home/user/app/audio/audio.wav'
|
260 |
+
st.audio(st.session_state['audio'])
|
261 |
|
262 |
|
263 |
|