cdleong commited on
Commit
f6906f4
·
1 Parent(s): 85c5ac2

if not yet uploaded...

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
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')
 
 
2
 
3
  if __name__ == "__main__":
4
  uploaded_file = st.file_uploader("Choose a file")
5
+ if uploaded_file is not None:
6
+ with open(uploaded_file, 'rb') as audio_file:
7
+ audio_bytes = audio_file.read()
8
+ st.audio(audio_bytes, format='audio/wav')