Spaces:
Running
Running
File size: 781 Bytes
6a69c09 dc80352 6a69c09 6003be0 6a69c09 7479c09 6a69c09 a35699b dc80352 6a69c09 6003be0 8f0fe45 6a69c09 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import os
import gradio as gr
import tempfile
import subprocess
from uuid import uuid4
from audio_sep_splitter import batch_process
def split_audio(audio_filepath):
output_file = ""
stem = "voice"
aggressiveness_factor = 2
splitter = "phoenix"
vocal_file = batch_process(audio_filepath, output_file, stem, aggressiveness_factor, splitter)
mp3_vocal_file = f"{vocal_file}.mp3"
subprocess.run(f"ffmpeg -i '{vocal_file}' '{mp3_vocal_file}'", shell=True)
return mp3_vocal_file
interface = gr.Interface(
split_audio,
gr.Audio(label="Upload audio", type="filepath"),
gr.Audio(label="Download audio", type="filepath")
)
if __name__=="__main__":
interface.queue().launch(auth=(os.environ.get("USERNAME"), os.environ.get("PASSWORD")))
|