Spaces:
Runtime error
Runtime error
Fix quote marks. -_-
Browse filesI blame the people at https://discuss.streamlit.io/t/audio-display/7806 for not formatting their code properly... and myself for copypasting from there instead of https://docs.streamlit.io/library/api-reference/media/st.audio
app.py
CHANGED
@@ -2,6 +2,6 @@ import streamlit as st
|
|
2 |
|
3 |
if __name__ == "__main__":
|
4 |
uploaded_file = st.file_uploader("Choose a file")
|
5 |
-
with open(uploaded_file,
|
6 |
audio_bytes = audio_file.read()
|
7 |
-
st.audio(audio_bytes, format
|
|
|
2 |
|
3 |
if __name__ == "__main__":
|
4 |
uploaded_file = st.file_uploader("Choose a file")
|
5 |
+
with open(uploaded_file, 'rb') as audio_file:
|
6 |
audio_bytes = audio_file.read()
|
7 |
+
st.audio(audio_bytes, format='audio/wav')
|