mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-30 09:13:57 +09:00
22 lines
735 B
Python
22 lines
735 B
Python
import subprocess
|
|
|
|
from modules.Log import (
|
|
PRINT_ULTRASTAR,
|
|
print_blue_highlighted_text,
|
|
print_red_highlighted_text,
|
|
)
|
|
from modules.os_helper import current_executor_path, move, path_join
|
|
|
|
|
|
def separate_audio(input_file_path, output_file, device="cpu"):
|
|
print(
|
|
f"{PRINT_ULTRASTAR} Separating vocals from audio with {print_blue_highlighted_text('demucs')} and {print_red_highlighted_text(device)} as worker."
|
|
)
|
|
# Model selection?
|
|
# -n mdx_q
|
|
# -n htdemucs_ft
|
|
# todo: -d cpu otherwise it automatically uses gpu
|
|
subprocess.run(["demucs", "--two-stems=vocals", input_file_path])
|
|
separated_folder = path_join(current_executor_path(), "separated")
|
|
move(separated_folder, output_file)
|