Files
UltraSinger/moduls/Audio/separation.py
T
Vadim cb5352a307 Reduced the denoise parameters
Optimized log messages
2023-05-19 14:19:20 +02:00

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)