import gradio as gr from pedalboard import Pedalboard, Chorus, Reverb, Distortion from pedalboard.io import AudioFile def greet(name,rooms): 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=rooms)]) # 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 output demo = gr.Interface(fn=greet, inputs=(gr.Audio(type="filepath"),gr.Slider(.02, 1, value=0.25),), outputs=gr.Audio(type="filepath")) demo.launch()