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.inputs.File(label="Upload MP3"), outputs=gr.outputs.File(label="Download Opus")) iface.launch(log=True)