Upload folder using huggingface_hub
Browse files
test.py
CHANGED
|
@@ -1,27 +1,10 @@
|
|
| 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 |
-
mic = gr.
|
| 12 |
-
|
| 13 |
-
waveform_options=gr.WaveformOptions(
|
| 14 |
-
waveform_color="#01C6FF",
|
| 15 |
-
waveform_progress_color="#0066B4",
|
| 16 |
-
skip_length=2,
|
| 17 |
-
show_controls=False,
|
| 18 |
-
),
|
| 19 |
-
)
|
| 20 |
|
| 21 |
-
mic.stop_recording(
|
| 22 |
-
fn=reverse_audio,
|
| 23 |
-
inputs=mic,
|
| 24 |
-
outputs=gr.Audio()
|
| 25 |
-
)
|
| 26 |
demo.launch()
|
| 27 |
-
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
with gr.Blocks(title="Mic Test") as demo:
|
| 4 |
src = "https://onj.me/shorts/audio/02-Who%27s%20the%20bossa%21.mp3"
|
| 5 |
gr.HTML(f"<audio src='{src}' autoplay controls></audio>", visible=True)
|
| 6 |
+
mic = gr.Microphone(editable=False, waveform_options={"show_controls":False})
|
| 7 |
+
mic.stop_recording(None, mic, None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
demo.launch()
|
| 10 |
+
#server_name="0.0.0.0", ssl_certfile="host.cert", ssl_keyfile="host.key", ssl_verify=False
|