netynet commited on
Commit
89bed8d
·
verified ·
1 Parent(s): 55390c3

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from audio_separator import Separator
3
+
4
+ def separate_audio(audio_file):
5
+ separator = Separator()
6
+ stems = separator.separate(audio_file, stem_names=["instrumental", "vocals", "backing_vocals"])
7
+ return stems["instrumental"], stems["vocals"], stems["backing_vocals"]
8
+
9
+ iface = gr.Interface(
10
+ fn=separate_audio,
11
+ inputs=gr.Audio(type="filepath", label="Upload Audio"),
12
+ outputs=[
13
+ gr.Audio(label="Instrumental"),
14
+ gr.Audio(label="Vocals"),
15
+ gr.Audio(label="Backing Vocals")
16
+ ],
17
+ title="Audio Separator",
18
+ description="Separate audio into instrumental, vocals, and backing vocals using audio-separator."
19
+ )
20
+
21
+ iface.launch()