utkarsh2299 commited on
Commit
c51462c
·
verified ·
1 Parent(s): 1649514

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -81,12 +81,8 @@ if selected_url:
81
  if response.status_code == 200:
82
  # Decode audio
83
  audio = response.json()['audio']
84
- file_name = "tts.mp3"
85
- with open(file_name, 'wb') as wav_file:
86
- decode_string = base64.b64decode(audio)
87
- wav_file.write(decode_string)
88
-
89
- st.audio(file_name, format='audio/mp3')
90
  else:
91
  st.error("Failed to generate speech. Please check your input and try again.")
92
  else:
 
81
  if response.status_code == 200:
82
  # Decode audio
83
  audio = response.json()['audio']
84
+ audio_bytes = base64.b64decode(audio)
85
+ st.audio(audio_bytes, format='audio/mp3')
 
 
 
 
86
  else:
87
  st.error("Failed to generate speech. Please check your input and try again.")
88
  else: