Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
|
|
3 |
def greet(name):
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
demo = gr.Interface(fn=greet, inputs=gr.Audio(type="filepath"), outputs=gr.Audio(type="filepath"))
|
8 |
|
|
|
1 |
import gradio as gr
|
2 |
+
from pedalboard import Pedalboard, Chorus, Reverb
|
3 |
+
from pedalboard.io import AudioFile
|
4 |
def greet(name):
|
5 |
+
with AudioFile(name) as f:
|
6 |
+
audio = f.read(f.frames)
|
7 |
+
samplerate = f.samplerate
|
8 |
+
|
9 |
+
# Make a Pedalboard object, containing multiple plugins:
|
10 |
+
board = Pedalboard([Chorus(), Reverb(room_size=0.25)])
|
11 |
+
|
12 |
+
# Run the audio through this pedalboard!
|
13 |
+
effected = board(audio, samplerate)
|
14 |
+
output = "output.wav"
|
15 |
+
# Write the audio back as a wav file:
|
16 |
+
with AudioFile('output.wav', 'w', samplerate, effected.shape[0]) as f:
|
17 |
+
f.write(effected)
|
18 |
+
return name
|
19 |
|
20 |
demo = gr.Interface(fn=greet, inputs=gr.Audio(type="filepath"), outputs=gr.Audio(type="filepath"))
|
21 |
|