Jaman commited on
Commit
4aa90c8
·
verified ·
1 Parent(s): e3017a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -30,13 +30,20 @@ def process_audio(file_path):
30
  splitter = BasicSplitter(file_path)
31
  splitter.run()
32
  st.write("Basic split process completed.")
 
 
 
 
 
 
 
33
  os.chdir(home_directory)
34
 
35
  return [
36
  os.path.join('basic_splits', file_name_without_ext, 'vocals.wav'),
 
37
  os.path.join('basic_splits', file_name_without_ext, 'bass.wav'),
38
- os.path.join('basic_splits', file_name_without_ext, 'drums.wav'),
39
- os.path.join('basic_splits', file_name_without_ext, 'accompaniment.wav')
40
  ]
41
 
42
  # Streamlit app
@@ -79,7 +86,7 @@ if uploaded_file is not None:
79
 
80
  # Display and download each generated audio
81
  for file in output_files:
82
- if file_exists(file):
83
  file_name = os.path.basename(file)
84
  if 'vocals.wav' in file_name:
85
  st.write('Vocal')
@@ -100,3 +107,4 @@ if uploaded_file is not None:
100
  )
101
  else:
102
  st.error(f"Error: {file} not found.")
 
 
30
  splitter = BasicSplitter(file_path)
31
  splitter.run()
32
  st.write("Basic split process completed.")
33
+
34
+ ensure_directory_exists(os.path.join('basic_splits', 'vocal_remover', file_name_without_ext))
35
+ os.chdir(os.path.join('basic_splits', 'vocal_remover', file_name_without_ext))
36
+ from moonarch_vocal_remover import VocalRemover
37
+ music_sep = VocalRemover(file_path)
38
+ music_sep.run()
39
+ st.write("Vocal remover process completed.")
40
  os.chdir(home_directory)
41
 
42
  return [
43
  os.path.join('basic_splits', file_name_without_ext, 'vocals.wav'),
44
+ os.path.join('basic_splits', 'vocal_remover', file_name_without_ext, 'accompaniment.wav'),
45
  os.path.join('basic_splits', file_name_without_ext, 'bass.wav'),
46
+ os.path.join('basic_splits', file_name_without_ext, 'drums.wav')
 
47
  ]
48
 
49
  # Streamlit app
 
86
 
87
  # Display and download each generated audio
88
  for file in output_files:
89
+ if os.path.isfile(file):
90
  file_name = os.path.basename(file)
91
  if 'vocals.wav' in file_name:
92
  st.write('Vocal')
 
107
  )
108
  else:
109
  st.error(f"Error: {file} not found.")
110
+ st.write(f"Expected location: {file}")