smjain commited on
Commit
13342a4
1 Parent(s): 1a4c7df

Upload myinfer_latest.py

Browse files
Files changed (1) hide show
  1. myinfer_latest.py +7 -1
myinfer_latest.py CHANGED
@@ -224,7 +224,11 @@ def cut_vocal_and_inst(audio_path,spk_id,unique_id):
224
  #logs.append("Starting the audio splitting process...")
225
  #yield "\n".join(logs), None, None
226
  print("before executing splitter")
227
- command = f"demucs --two-stems=vocals -n {split_model} {audio_path} -o -o output/{spk_id}_{unique_id}"
 
 
 
 
228
  #result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
229
  result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
230
  if result.returncode != 0:
@@ -252,6 +256,8 @@ def combine_vocal_and_inst(vocal_path, inst_path, output_path):
252
  #command = f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex [0:a]volume={inst_volume}[i];[1:a]volume={vocal_volume}[v];[i][v]amix=inputs=2:duration=longest[a] -map [a] -b:a 320k -c:a libmp3lame "{output_path}"'
253
  #command=f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex "amix=inputs=2:duration=longest" -b:a 320k -c:a libmp3lame "{output_path}"'
254
  # Load the audio files
 
 
255
  vocal = AudioSegment.from_file(vocal_path)
256
  instrumental = AudioSegment.from_file(inst_path)
257
 
 
224
  #logs.append("Starting the audio splitting process...")
225
  #yield "\n".join(logs), None, None
226
  print("before executing splitter")
227
+ command = f"demucs --two-stems=vocals -n {split_model} {audio_path} -o output/{spk_id}_{unique_id}"
228
+
229
+
230
+
231
+
232
  #result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, text=True)
233
  result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
234
  if result.returncode != 0:
 
256
  #command = f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex [0:a]volume={inst_volume}[i];[1:a]volume={vocal_volume}[v];[i][v]amix=inputs=2:duration=longest[a] -map [a] -b:a 320k -c:a libmp3lame "{output_path}"'
257
  #command=f'ffmpeg -y -i "{inst_path}" -i "{vocal_path}" -filter_complex "amix=inputs=2:duration=longest" -b:a 320k -c:a libmp3lame "{output_path}"'
258
  # Load the audio files
259
+ print(vocal_path)
260
+ print(inst_path)
261
  vocal = AudioSegment.from_file(vocal_path)
262
  instrumental = AudioSegment.from_file(inst_path)
263