Run VAD on all incoming audio frames
Some checks failed
Build and Push EVS Bridge Image / docker (push) Has been cancelled
Some checks failed
Build and Push EVS Bridge Image / docker (push) Has been cancelled
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user