Spaces:
Running
Running
Upload infertest.py
Browse files- infertest.py +10 -1
infertest.py
CHANGED
|
@@ -479,7 +479,16 @@ def combine_vocal_and_inst(vocal_path, inst_path):
|
|
| 479 |
# Assuming vocal_path and inst_path are now directly passed as arguments
|
| 480 |
output_path = "output/result/combine.mp3"
|
| 481 |
#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}"'
|
| 482 |
-
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}"'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 483 |
result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 484 |
if result.stderr:
|
| 485 |
print("Error:", result.stderr.decode())
|
|
|
|
| 479 |
# Assuming vocal_path and inst_path are now directly passed as arguments
|
| 480 |
output_path = "output/result/combine.mp3"
|
| 481 |
#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}"'
|
| 482 |
+
#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}"'
|
| 483 |
+
command = [
|
| 484 |
+
'ffmpeg', '-y',
|
| 485 |
+
'-i', inst_path,
|
| 486 |
+
'-i', vocal_path,
|
| 487 |
+
'-filter_complex', 'amix=inputs=2:duration=longest',
|
| 488 |
+
'-b:a', '320k',
|
| 489 |
+
'-c:a', 'libmp3lame',
|
| 490 |
+
output_path
|
| 491 |
+
]
|
| 492 |
result = subprocess.run(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 493 |
if result.stderr:
|
| 494 |
print("Error:", result.stderr.decode())
|