Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,7 @@ def stream_alert_audio(text_prompt):
|
|
79 |
print(f"Audio stream started for: '{text_prompt}'")
|
80 |
# Yield audio chunks as they become available
|
81 |
for new_audio_chunk in streamer:
|
82 |
-
yield
|
83 |
finally:
|
84 |
# CRITICAL: This block runs after the generator is exhausted (audio finishes)
|
85 |
# We reset the alerter state so that a new alert can be triggered later.
|
@@ -144,7 +144,8 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as app:
|
|
144 |
label="Alert System",
|
145 |
autoplay=True,
|
146 |
visible=False, # Hide the player controls
|
147 |
-
streaming=True
|
|
|
148 |
)
|
149 |
|
150 |
webcam_input.stream(
|
|
|
79 |
print(f"Audio stream started for: '{text_prompt}'")
|
80 |
# Yield audio chunks as they become available
|
81 |
for new_audio_chunk in streamer:
|
82 |
+
yield new_audio_chunk
|
83 |
finally:
|
84 |
# CRITICAL: This block runs after the generator is exhausted (audio finishes)
|
85 |
# We reset the alerter state so that a new alert can be triggered later.
|
|
|
144 |
label="Alert System",
|
145 |
autoplay=True,
|
146 |
visible=False, # Hide the player controls
|
147 |
+
streaming=True,
|
148 |
+
sample_rate=model.config.sampling_rate
|
149 |
)
|
150 |
|
151 |
webcam_input.stream(
|