Aashiue's picture
Create utils.py
439a401 verified
raw
history blame contribute delete
349 Bytes
import nussl
import os
def run_separation(file_path):
signal = nussl.AudioSignal(file_path)
repet = nussl.separation.primitive.Repet(signal)
bg, fg = repet()
bg_file = "bg.wav"
fg_file = "fg.wav"
bg.write_audio_to_file(bg_file)
fg.write_audio_to_file(fg_file)
return {"background": bg_file, "foreground": fg_file}