mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-10-30 22:01:57 +01:00
Update icad_tone.py
This commit is contained in:
1 parent
c79f3cdfbc
commit
c31947194e
1 file changed
+3
@@ -194,6 +194,9 @@ def main():
|
||||
)
|
||||
detect_and_alert(audio, SAMPLE_RATE)
|
||||
buffer = buffer[DETECTION_CHUNK:] # keep remainder for next window
|
||||
# Prevent buffer from growing forever
|
||||
if buffer.size > DETECTION_CHUNK * 10:
|
||||
buffer = buffer[-DETECTION_CHUNK*10:]
|
||||
except Exception as e:
|
||||
print(f"Callback error: {e}", file=sys.stderr)
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user