File size: 772 Bytes
f3da96c
13b0b87
fc29229
dffb5f5
fc29229
 
 
 
728ba5c
785fc38
fc29229
728ba5c
b12a7fc
 
728ba5c
b12a7fc
 
a7871b6
2e35a47
dffb5f5
2e35a47
054ac98
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()