rbarman commited on
Commit
61d8ace
1 Parent(s): 368f8e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -114,16 +114,18 @@ selected_stem_count = st.radio("Select stem count", (2,4,5))
114
 
115
  if uploaded_file is not None:
116
 
117
- # Save the uploaded file to a temporary location
118
- with tempfile.NamedTemporaryFile(delete=False) as temp_file:
119
- temp_file.write(uploaded_file.read())
120
- temp_file_path = temp_file.name
 
 
 
 
 
121
 
122
- # Process the uploaded audio file
123
- separate_audios = separate_audio_by_stem(temp_file_path, selected_stem_count)
124
-
125
- # Display the output files for download
126
- st.write("Output Files:")
127
- for audio in separate_audios:
128
- st.write(audio['description'])
129
- st.audio(audio['path'], format="audio/wav", start_time=0)
 
114
 
115
  if uploaded_file is not None:
116
 
117
+ if st.button("Submit"):
118
+
119
+ # Save the uploaded file to a temporary location
120
+ with tempfile.NamedTemporaryFile(delete=False) as temp_file:
121
+ temp_file.write(uploaded_file.read())
122
+ temp_file_path = temp_file.name
123
+
124
+ # Process the uploaded audio file
125
+ separate_audios = separate_audio_by_stem(temp_file_path, selected_stem_count)
126
 
127
+ # Display the output files for download
128
+ st.write("Output Files:")
129
+ for audio in separate_audios:
130
+ st.write(audio['description'])
131
+ st.audio(audio['path'], format="audio/wav", start_time=0)