Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
85 |
-
|
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:
|