import nussl import os def separate_audio(file_path): # Load the audio signal signal = nussl.AudioSignal(file_path) # Apply Repet separation repet = nussl.separation.primitive.Repet(signal) bg, fg = repet() # Save the outputs bg_file = "background.wav" fg_file = "foreground.wav" bg.write_audio_to_file(bg_file) fg.write_audio_to_file(fg_file) return bg_file, fg_file