smjain commited on
Commit
3423c18
1 Parent(s): 2b04bca

Upload infertest.py

Browse files
Files changed (1) hide show
  1. infertest.py +3 -1
infertest.py CHANGED
@@ -479,7 +479,9 @@ def combine_vocal_and_inst(vocal_path, inst_path):
479
  os.makedirs("output/result", exist_ok=True)
480
  # Assuming vocal_path and inst_path are now directly passed as arguments
481
  output_path = "output/result/combine.mp3"
482
- 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}"'
 
 
483
  result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
484
  if result.stderr:
485
  print("Error:", result.stderr.decode())
 
479
  os.makedirs("output/result", exist_ok=True)
480
  # Assuming vocal_path and inst_path are now directly passed as arguments
481
  output_path = "output/result/combine.mp3"
482
+ #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}"'
483
+ 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}"'
484
+ '
485
  result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
486
  if result.stderr:
487
  print("Error:", result.stderr.decode())