File size: 643 Bytes
ed3942b
37e9cb7
 
 
 
ed3942b
37e9cb7
 
 
 
 
 
 
ed3942b
37e9cb7
 
ed3942b
37e9cb7
 
ed3942b
 
37e9cb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
import librosa
import soundfile as sf
import numpy as np
from utils import run_separation

def separate_and_play(file):
    separated = run_separation(file)
    return separated['background'], separated['foreground']

demo = gr.Interface(
    fn=separate_and_play,
    inputs=gr.Audio(type="filepath", label="Upload Mixed Audio"),
    outputs=[
        gr.Audio(label="Background"),
        gr.Audio(label="Foreground"),
    ],
    title="Speaker Source Separation",
    description="Upload a mixed audio file to hear separated background and foreground tracks using traditional audio separation methods."
)

demo.launch()