amirgame197 commited on
Commit
4a5dfc8
·
verified ·
1 Parent(s): 7b0f702

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -107,18 +107,15 @@ selected_stem_count = 2
107
 
108
  if uploaded_file is not None:
109
 
110
- if st.button("Submit"):
111
 
112
- # Save the uploaded file to a temporary location
113
- with tempfile.NamedTemporaryFile(delete=False) as temp_file:
114
- temp_file.write(uploaded_file.read())
115
- temp_file_path = temp_file.name
116
 
117
- # Process the uploaded audio file
118
- separate_audios = separate_audio_by_stem(temp_file_path, selected_stem_count)
119
 
120
- # Display the output files for download
121
- st.write("Output Files:")
122
- for audio in separate_audios:
123
- st.write(audio['description'])
124
- st.audio(audio['path'], format="audio/wav", start_time=0)
 
107
 
108
  if uploaded_file is not None:
109
 
110
+ #if st.button("Submit"):
111
 
112
+ with tempfile.NamedTemporaryFile(delete=False) as temp_file:
113
+ temp_file.write(uploaded_file.read())
114
+ temp_file_path = temp_file.name
 
115
 
116
+ separate_audios = separate_audio_by_stem(temp_file_path, selected_stem_count)
 
117
 
118
+ st.write("Output Files:")
119
+ for audio in separate_audios:
120
+ st.write(audio['description'])
121
+ st.audio(audio['path'], format="audio/wav", start_time=0)