Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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"
|
|
|
|
|
|
|
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
|