File size: 324 Bytes
798b4d1
1ded5ed
798b4d1
a2cc1ee
 
 
 
798b4d1
3003326
249cf57
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from pydub import AudioSegment

def convert(input_file):
    sound = AudioSegment.from_mp3(input_file.name)
    sound.export("output.opus", format="opus")
    return "output.opus"

iface = gr.Interface(fn=convert, inputs=gr.File(label="Upload MP3"), outputs=gr.File(label="Download Opus"))
iface.launch()