Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -217,15 +217,17 @@ def process_audio_query(audio_input):
|
|
217 |
audio_path = generate_audio_elevenlabs(response_text)
|
218 |
return audio_path
|
219 |
|
220 |
-
#
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
)
|
|
|
|
|
229 |
|
230 |
# Launch the Gradio app
|
231 |
interface.launch()
|
|
|
217 |
audio_path = generate_audio_elevenlabs(response_text)
|
218 |
return audio_path
|
219 |
|
220 |
+
# Function to handle submit button click
|
221 |
+
def on_submit(audio_input):
|
222 |
+
return process_audio_query(audio_input)
|
223 |
+
|
224 |
+
# Create Gradio interface for audio input, submit button, and output
|
225 |
+
with gr.Blocks() as interface:
|
226 |
+
audio_input = gr.Audio(source="microphone", type="numpy", streaming=True)
|
227 |
+
submit_button = gr.Button("Submit")
|
228 |
+
audio_output = gr.Audio(type="filepath", autoplay=True)
|
229 |
+
|
230 |
+
submit_button.click(fn=on_submit, inputs=audio_input, outputs=audio_output)
|
231 |
|
232 |
# Launch the Gradio app
|
233 |
interface.launch()
|