mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-28 01:48:56 +09:00
15 lines
713 B
Python
15 lines
713 B
Python
import subprocess
|
|
from moduls.os_helper import move, current_executor_path, path_join
|
|
from moduls.Log import PRINT_ULTRASTAR, print_blue_highlighted_text, print_red_highlighted_text
|
|
|
|
|
|
def separate_audio(input_file_path, output_file, device="cpu"):
|
|
print("{} Separating vocals from audio with {} and {} as worker.".format(PRINT_ULTRASTAR, print_blue_highlighted_text("demucs"), print_red_highlighted_text(device)))
|
|
# 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)
|