Spaces:
Sleeping
Sleeping
ASG Models
commited on
Commit
•
273cd6b
1
Parent(s):
41a1a62
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
|
8 |
+
def reverse_audio(audio):
|
9 |
+
sr, data = audio
|
10 |
+
return (sr, np.flipud(data))
|
11 |
+
|
12 |
+
|
13 |
+
input_audio = gr.Audio(
|
14 |
+
sources=["microphone"],
|
15 |
+
waveform_options=gr.WaveformOptions(
|
16 |
+
waveform_color="#01C6FF",
|
17 |
+
waveform_progress_color="#0066B4",
|
18 |
+
skip_length=2,
|
19 |
+
show_controls=False,
|
20 |
+
),
|
21 |
+
)
|
22 |
+
demo = gr.Interface(
|
23 |
+
fn=reverse_audio,
|
24 |
+
inputs=input_audio,
|
25 |
+
outputs="audio"
|
26 |
+
)
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
demo.launch()
|