owiedotch commited on
Commit
c3c9d62
1 Parent(s): 1746d53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -58,7 +58,10 @@ def inference(audio_file, model_name, vocals, drums, bass, other, mp3, mp3_bitra
58
  os.rename(selected_stems[0], output_file)
59
  else:
60
  # Otherwise, use ffmpeg to mix the stems
61
- ffmpeg_cmd = ["ffmpeg", "-y", "-i"] + selected_stems + ["-filter_complex", "amix=inputs=" + str(len(selected_stems)) + ":duration=longest", output_file]
 
 
 
62
  subprocess.run(ffmpeg_cmd, check=True)
63
 
64
  return output_file
 
58
  os.rename(selected_stems[0], output_file)
59
  else:
60
  # Otherwise, use ffmpeg to mix the stems
61
+ ffmpeg_cmd = ["ffmpeg", "-y"]
62
+ for stem in selected_stems:
63
+ ffmpeg_cmd.extend(["-i", f"\"{stem}\""]) # Quote file paths
64
+ ffmpeg_cmd.extend(["-filter_complex", f"amix=inputs={len(selected_stems)}:duration=longest", f"\"{output_file}\""]) # Quote file paths
65
  subprocess.run(ffmpeg_cmd, check=True)
66
 
67
  return output_file