Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,8 @@ with open("config.yaml") as f:
|
|
29 |
detector = get_detector(CFG)
|
30 |
|
31 |
# βββββββββββββββββββββββββββββ alert sound (read once)
|
32 |
-
wav_path = CFG["alerting"].get("alert_sound_path"
|
|
|
33 |
try:
|
34 |
ALERT_SR, ALERT_DATA = sf.read(wav_path, dtype="float32")
|
35 |
logging.info(f"Loaded alert sound: {wav_path} ({len(ALERT_DATA)/ALERT_SR:.2f}s)")
|
@@ -71,7 +72,7 @@ def process_live_frame(frame, last_alert_ts):
|
|
71 |
|
72 |
audio_out = None
|
73 |
new_last_alert_ts = last_alert_ts
|
74 |
-
ALERT_COOLDOWN = CFG["alerting"].get("alert_cooldown_seconds",
|
75 |
|
76 |
if (
|
77 |
ALERT_DATA is not None
|
|
|
29 |
detector = get_detector(CFG)
|
30 |
|
31 |
# βββββββββββββββββββββββββββββ alert sound (read once)
|
32 |
+
wav_path = CFG["alerting"].get("alert_sound_path")
|
33 |
+
logging.info(f"Processing {wav_path}")
|
34 |
try:
|
35 |
ALERT_SR, ALERT_DATA = sf.read(wav_path, dtype="float32")
|
36 |
logging.info(f"Loaded alert sound: {wav_path} ({len(ALERT_DATA)/ALERT_SR:.2f}s)")
|
|
|
72 |
|
73 |
audio_out = None
|
74 |
new_last_alert_ts = last_alert_ts
|
75 |
+
ALERT_COOLDOWN = CFG["alerting"].get("alert_cooldown_seconds", 5)
|
76 |
|
77 |
if (
|
78 |
ALERT_DATA is not None
|