Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def reverse_audio(audio):
|
6 |
+
sr, data = audio
|
7 |
+
return (sr, np.flipud(data))
|
8 |
+
|
9 |
+
input_audio = gr.Audio(
|
10 |
+
sources=["microphone"],
|
11 |
+
waveform_options=gr.WaveformOptions(
|
12 |
+
waveform_color="#01C6FF",
|
13 |
+
waveform_progress_color="#0066B4",
|
14 |
+
skip_length=2,
|
15 |
+
show_controls=False,
|
16 |
+
),
|
17 |
+
)
|
18 |
+
demo = gr.Interface(
|
19 |
+
fn=reverse_audio,
|
20 |
+
inputs=input_audio,
|
21 |
+
outputs="audio"
|
22 |
+
)
|
23 |
+
|
24 |
+
if __name__ == "__main__":
|
25 |
+
demo.launch()
|