File size: 716 Bytes
f3da96c
fc29229
 
a249dc2
fc29229
 
 
 
 
b12a7fc
fc29229
 
b12a7fc
 
fc29229
b12a7fc
 
 
2e35a47
e45f3b3
2e35a47
a249dc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()