Spaces:
Sleeping
Sleeping
..
Browse files
app.py
CHANGED
|
@@ -198,11 +198,16 @@ def build_app() -> gr.Blocks:
|
|
| 198 |
sources = ["microphone"],
|
| 199 |
streaming = True,
|
| 200 |
type = "numpy",
|
| 201 |
-
label = "Microphone
|
| 202 |
interactive= True,
|
| 203 |
elem_id = "audio-input",
|
| 204 |
)
|
| 205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
vad_dot = gr.Markdown("⚫ _mic idle_", elem_id="vad-dot")
|
| 207 |
|
| 208 |
with gr.Row():
|
|
@@ -338,6 +343,10 @@ def build_app() -> gr.Blocks:
|
|
| 338 |
"""
|
| 339 |
state = _get_or_create_session(state)
|
| 340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
if not state.call_active:
|
| 342 |
# Return current state without processing
|
| 343 |
u = state._build_update()
|
|
|
|
| 198 |
sources = ["microphone"],
|
| 199 |
streaming = True,
|
| 200 |
type = "numpy",
|
| 201 |
+
label = "Microphone input",
|
| 202 |
interactive= True,
|
| 203 |
elem_id = "audio-input",
|
| 204 |
)
|
| 205 |
|
| 206 |
+
gr.Markdown(
|
| 207 |
+
"_Tip: click the microphone widget to grant browser permission, then speak. "
|
| 208 |
+
"The call will start automatically on the first live audio input, or you can press 📞 Start Call._"
|
| 209 |
+
)
|
| 210 |
+
|
| 211 |
vad_dot = gr.Markdown("⚫ _mic idle_", elem_id="vad-dot")
|
| 212 |
|
| 213 |
with gr.Row():
|
|
|
|
| 343 |
"""
|
| 344 |
state = _get_or_create_session(state)
|
| 345 |
|
| 346 |
+
if audio_chunk is not None and not state.call_active:
|
| 347 |
+
logger.info("Auto-starting call session on first live audio input.")
|
| 348 |
+
state.start_call()
|
| 349 |
+
|
| 350 |
if not state.call_active:
|
| 351 |
# Return current state without processing
|
| 352 |
u = state._build_update()
|