vishwask commited on
Commit
f5ba9bc
·
1 Parent(s): 47b76c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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
- 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
 
 
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