Run VAD on all incoming audio frames
Some checks failed
Build and Push EVS Bridge Image / docker (push) Has been cancelled

This commit is contained in:
Kai
2026-02-13 17:31:47 +01:00
parent 5f20b38088
commit 1ef1b7e2b0

View File

@@ -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: async def handle_binary_message(device_id: str, session: DeviceSession, data: bytes) -> None:
session.last_rx_ts = time.time() 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: if session.ptt_active:
session.rx_bytes_total += len(data) session.rx_bytes_total += len(data)
if SAVE_SESSIONS: 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. # Keep newest data within cap to avoid unbounded memory growth.
drop = len(session.pcm_bytes) - MAX_SESSION_BYTES drop = len(session.pcm_bytes) - MAX_SESSION_BYTES
del session.pcm_bytes[:drop] del session.pcm_bytes[:drop]
process_vad_frame(device_id, session, data)
if ECHO_ENABLED: if ECHO_ENABLED:
await session.ws.send(data) await session.ws.send(data)