From 1ef1b7e2b05c72667968946deb2ec43324510d17 Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 13 Feb 2026 17:31:47 +0100 Subject: [PATCH] Run VAD on all incoming audio frames --- bridge/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridge/app.py b/bridge/app.py index f3be889..af77511 100644 --- a/bridge/app.py +++ b/bridge/app.py @@ -409,6 +409,8 @@ async def handle_text_message(device_id: str, session: DeviceSession, raw: str) async def handle_binary_message(device_id: str, session: DeviceSession, data: bytes) -> None: session.last_rx_ts = time.time() + # VAD should work on continuous stream even if explicit start/stop is missing. + process_vad_frame(device_id, session, data) if session.ptt_active: session.rx_bytes_total += len(data) if SAVE_SESSIONS: @@ -419,7 +421,6 @@ async def handle_binary_message(device_id: str, session: DeviceSession, data: by # Keep newest data within cap to avoid unbounded memory growth. drop = len(session.pcm_bytes) - MAX_SESSION_BYTES del session.pcm_bytes[:drop] - process_vad_frame(device_id, session, data) if ECHO_ENABLED: await session.ws.send(data)