SaileshSivan commited on
Commit
aad1a7b
·
1 Parent(s): 7b463a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -95,8 +95,9 @@ if submit:
95
  # Embed audio in the webpage without saving it
96
  # st.audio(audio_response.content, format="audio/mp3")
97
 
 
98
  audio_url = f"data:audio/mp3;base64,{base64.b64encode(audio_response.content).decode()}"
99
- st.audio(audio_url, format="audio/mp3", start_time=0, autoplay=True)
100
 
101
 
102
 
 
95
  # Embed audio in the webpage without saving it
96
  # st.audio(audio_response.content, format="audio/mp3")
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