Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,15 +80,9 @@ def transcribe_fn(audio_file):
|
|
| 80 |
with gr.Blocks() as demo:
|
| 81 |
gr.Markdown("# 🔊 FireRedASR 实时语音识别 Demo\n支持麦克风实时识别 + 文件上传")
|
| 82 |
|
| 83 |
-
with gr.Tab("
|
| 84 |
-
gr.Markdown("
|
| 85 |
-
|
| 86 |
-
output_text = gr.Textbox()
|
| 87 |
-
mic_audio.stream(fn=transcribe_fn, inputs=mic_audio, outputs=output_text)
|
| 88 |
-
|
| 89 |
-
with gr.Tab("📁 文件上传识别"):
|
| 90 |
-
gr.Markdown("上传音频文件,点击按钮进行识别。")
|
| 91 |
-
file_audio = gr.Audio(source="upload", type="filepath", label="上传音频文件(支持 WAV/MP3 等)")
|
| 92 |
file_output = gr.Textbox(label="识别结果")
|
| 93 |
file_btn = gr.Button("开始识别")
|
| 94 |
file_btn.click(fn=transcribe_fn, inputs=file_audio, outputs=file_output)
|
|
|
|
| 80 |
with gr.Blocks() as demo:
|
| 81 |
gr.Markdown("# 🔊 FireRedASR 实时语音识别 Demo\n支持麦克风实时识别 + 文件上传")
|
| 82 |
|
| 83 |
+
with gr.Tab("📁 文件上传识别或者实时麦克风录音"):
|
| 84 |
+
gr.Markdown("上传音频文件或者实时录音,点击按钮进行识别。")
|
| 85 |
+
file_audio = gr.Audio(sources=["upload"], type="filepath", label="上传音频文件(支持 WAV/MP3 等)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
file_output = gr.Textbox(label="识别结果")
|
| 87 |
file_btn = gr.Button("开始识别")
|
| 88 |
file_btn.click(fn=transcribe_fn, inputs=file_audio, outputs=file_output)
|