Spaces:
Sleeping
Sleeping
Commit
·
b29e7ad
1
Parent(s):
aad1a7b
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,15 +93,9 @@ if submit:
|
|
| 93 |
)
|
| 94 |
|
| 95 |
# Embed audio in the webpage without saving it
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
# Embed audio in the webpage with JavaScript for autoplay
|
| 99 |
-
audio_url = f"data:audio/mp3;base64,{base64.b64encode(audio_response.content).decode()}"
|
| 100 |
-
st.markdown(f'<audio autoplay controls><source src="{audio_url}" type="audio/mp3"></audio>', unsafe_allow_html=True)
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
|
|
|
|
| 105 |
|
| 106 |
else:
|
| 107 |
st.subheader("Error: Unable to get response. Please try again later.")
|
|
|
|
| 93 |
)
|
| 94 |
|
| 95 |
# Embed audio in the webpage without saving it
|
| 96 |
+
st.audio(audio_response.content, format="audio/mp3")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
|
| 99 |
|
| 100 |
else:
|
| 101 |
st.subheader("Error: Unable to get response. Please try again later.")
|