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)