vian123 commited on
Commit
f38a455
·
verified ·
1 Parent(s): a2dca05

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -6
src/streamlit_app.py CHANGED
@@ -29,13 +29,14 @@ class Interface:
29
  st.info(description)
30
 
31
  @staticmethod
32
- def get_audio_file() -> str:
33
  uploaded_file = st.file_uploader("Choose an audio file", type=["wav"], help="Upload a .wav audio file.")
34
- if uploaded_file and uploaded_file.name.endswith(".wav"):
35
- st.audio(uploaded_file, format="audio/wav")
36
- return uploaded_file
37
- elif uploaded_file:
38
- st.warning("Please upload a valid .wav audio file.")
 
39
  return None
40
 
41
  @staticmethod
 
29
  st.info(description)
30
 
31
  @staticmethod
32
+ def get_audio_file():
33
  uploaded_file = st.file_uploader("Choose an audio file", type=["wav"], help="Upload a .wav audio file.")
34
+ if uploaded_file is not None:
35
+ if uploaded_file.name.endswith(".wav"):
36
+ st.audio(uploaded_file, format="audio/wav")
37
+ return uploaded_file # Return UploadedFile, not str
38
+ else:
39
+ st.warning("Please upload a valid .wav audio file.")
40
  return None
41
 
42
  @staticmethod