File size: 552 Bytes
31f32e6
 
227d904
31f32e6
227d904
 
 
 
6644169
 
4e34ae0
6644169
6a68038
31f32e6
4e34ae0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr

def get_audio(audio):
	src = "https://onj.me/shorts/audio/02-Who%27s%20the%20bossa%21.mp3"
	return f"<audio src='{src}' autoplay controls></audio>"

with gr.Blocks(title="Mic Test") as demo:
	audio_element = gr.HTML()
	play = gr.Button("Play Music")
	play.click(get_audio, None, audio_element)
	mic = gr.Microphone(editable=False, waveform_options={"show_controls":False})
	mic.stop_recording(None, mic, None)

demo.launch()
#server_name="0.0.0.0", ssl_certfile="host.cert", ssl_keyfile="host.key", ssl_verify=False