Upload folder using huggingface_hub
Browse files- README.md +3 -9
- requirements.txt +1 -0
- test.py +28 -0
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.36.
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: mic_test
|
3 |
+
app_file: test.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
+
sdk_version: 4.36.0
|
|
|
|
|
6 |
---
|
|
|
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio
|
test.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def reverse_audio(audio):
|
5 |
+
sr, data = audio
|
6 |
+
return audio
|
7 |
+
|
8 |
+
with gr.Blocks(title="Mic Test") as demo:
|
9 |
+
src = "https://onj.me/shorts/audio/02-Who%27s%20the%20bossa%21.mp3"
|
10 |
+
gr.HTML(f"<audio src='{src}' autoplay controls></audio>", visible=True)
|
11 |
+
|
12 |
+
mic = gr.Audio(
|
13 |
+
sources=["microphone"],
|
14 |
+
waveform_options=gr.WaveformOptions(
|
15 |
+
waveform_color="#01C6FF",
|
16 |
+
waveform_progress_color="#0066B4",
|
17 |
+
skip_length=2,
|
18 |
+
show_controls=False,
|
19 |
+
),
|
20 |
+
)
|
21 |
+
mic.stop_recording(
|
22 |
+
fn=reverse_audio,
|
23 |
+
inputs=mic,
|
24 |
+
outputs=gr.Audio()
|
25 |
+
)
|
26 |
+
|
27 |
+
demo.launch()
|
28 |
+
|