Spaces:
Running
Running
| import gradio as gr | |
| def create_interface(): | |
| with gr.Blocks() as interface: | |
| gr.Markdown("# Word Counter") | |
| gr.Markdown("Enter a word to count, then start listening to your microphone") | |
| with gr.Row(): | |
| target_word = gr.Textbox(label="Target Word", placeholder="Enter word to count") | |
| with gr.Row(): | |
| counter_display = gr.Number(label="Count", value=0, interactive=False) | |
| with gr.Row(): | |
| audio_input = gr.Audio(sources=["microphone"], type="filepath", streaming=True) | |
| with gr.Row(): | |
| start_btn = gr.Button("Start", variant="primary") | |
| stop_btn = gr.Button("Stop", variant="secondary") | |
| reset_btn = gr.Button("Reset", variant="stop") | |
| return interface, target_word, counter_display, audio_input, start_btn, stop_btn, reset_btn | |