Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,16 +39,6 @@ def main():
|
|
| 39 |
audio_file = open('demo.mp3', 'rb')
|
| 40 |
audio_bytes = audio_file.read()
|
| 41 |
st.audio(audio_bytes, format='audio/ogg',start_time=0)
|
| 42 |
-
html_string = """
|
| 43 |
-
<audio controls autoplay>
|
| 44 |
-
<source src="https://www.orangefreesounds.com/wp-content/uploads/2022/04/Small-bell-ringing-short-sound-effect.mp3" type="audio/mp3">
|
| 45 |
-
</audio>
|
| 46 |
-
"""
|
| 47 |
-
|
| 48 |
-
sound = st.empty()
|
| 49 |
-
sound.markdown(html_string, unsafe_allow_html=True) # will display a st.audio with the sound you specified in the "src" of the #html_string and autoplay it
|
| 50 |
-
time.sleep(2) # wait for 2 seconds to finish the playing of the audio
|
| 51 |
-
sound.empty()
|
| 52 |
|
| 53 |
if __name__ == '__main__' :
|
| 54 |
main()
|
|
|
|
| 39 |
audio_file = open('demo.mp3', 'rb')
|
| 40 |
audio_bytes = audio_file.read()
|
| 41 |
st.audio(audio_bytes, format='audio/ogg',start_time=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
if __name__ == '__main__' :
|
| 44 |
main()
|