rbarman commited on
Commit
f94e46a
1 Parent(s): 5f6adf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -78,7 +78,23 @@ def separate_audio_by_stem(audio_path, stem_count):
78
 
79
  return [vocals_path, drums_path, bass_path, other_path]
80
 
 
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  # Streamlit app content
84
  st.write("Upload an audio file")
@@ -94,7 +110,7 @@ if uploaded_file is not None:
94
  temp_file_path = temp_file.name
95
 
96
  # Process the uploaded audio file
97
- separated_audio_paths = separate_audio_by_stem(temp_file_path)
98
 
99
  # Display the output files for download
100
  st.write("Output Files:")
 
78
 
79
  return [vocals_path, drums_path, bass_path, other_path]
80
 
81
+ elif stem_count == 5:
82
 
83
+
84
+ piano_path = f"{gradio_temp_path}/separated_audio/{audio_filename}/piano.wav"
85
+ vocals_path = f"{gradio_temp_path}/separated_audio/{audio_filename}/vocals.wav"
86
+ drums_path = f"{gradio_temp_path}/separated_audio/{audio_filename}/drums.wav"
87
+ bass_path = f"{gradio_temp_path}/separated_audio/{audio_filename}/bass.wav"
88
+ other_path = f"{gradio_temp_path}/separated_audio/{audio_filename}/other.wav"
89
+
90
+ print(f"{piano_path=} \t exists: {os.path.exists(vocals_path)}")
91
+ print(f"{vocals_path=} \t exists: {os.path.exists(vocals_path)}")
92
+ print(f"{drums_path=} \t exists: {os.path.exists(drums_path)}")
93
+ print(f"{bass_path=} \t exists: {os.path.exists(bass_path)}")
94
+ print(f"{other_path=} \t exists: {os.path.exists(other_path)}")
95
+
96
+
97
+ return [piano_path, vocals_path, drums_path, bass_path, other_path]
98
 
99
  # Streamlit app content
100
  st.write("Upload an audio file")
 
110
  temp_file_path = temp_file.name
111
 
112
  # Process the uploaded audio file
113
+ separated_audio_paths = separate_audio_by_stem(temp_file_path, selected_stem_count)
114
 
115
  # Display the output files for download
116
  st.write("Output Files:")