Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,13 +102,13 @@ with gr.Blocks() as demo:
|
|
| 102 |
state = gr.State(value=json.dumps({}))
|
| 103 |
|
| 104 |
with gr.Row():
|
| 105 |
-
|
| 106 |
output_text = gr.Textbox(label="Response Text", interactive=False)
|
| 107 |
|
| 108 |
with gr.Row():
|
| 109 |
voice_output = gr.Audio(label="Response Audio", autoplay=True)
|
| 110 |
|
| 111 |
# Automatically process audio when recording stops
|
| 112 |
-
|
| 113 |
|
| 114 |
demo.launch()
|
|
|
|
| 102 |
state = gr.State(value=json.dumps({}))
|
| 103 |
|
| 104 |
with gr.Row():
|
| 105 |
+
mic_button = gr.Audio(type="microphone", label="Speak Now")
|
| 106 |
output_text = gr.Textbox(label="Response Text", interactive=False)
|
| 107 |
|
| 108 |
with gr.Row():
|
| 109 |
voice_output = gr.Audio(label="Response Audio", autoplay=True)
|
| 110 |
|
| 111 |
# Automatically process audio when recording stops
|
| 112 |
+
mic_button.change(restaurant_voice_assistant, inputs=[mic_button, state], outputs=[output_text, voice_output, state])
|
| 113 |
|
| 114 |
demo.launch()
|