import gradio as gr from pedalboard import Pedalboard, Chorus, Reverb from pedalboard.io import AudioFile def greet(name): with AudioFile(name) as f: audio = f.read(f.frames) samplerate = f.samplerate # Make a Pedalboard object, containing multiple plugins: board = Pedalboard([Chorus(), Reverb(room_size=0.25)]) # Run the audio through this pedalboard! effected = board(audio, samplerate) output = "output.wav" # Write the audio back as a wav file: with AudioFile('output.wav', 'w', samplerate, effected.shape[0]) as f: f.write(effected) return name demo = gr.Interface(fn=greet, inputs=gr.Audio(type="filepath"), outputs=gr.Audio(type="filepath")) demo.launch()