Merge pull request #2455 from xinnan-tech/py_fix_packet

fix: 等待音频过长时需修正包状态
This commit is contained in:
hrz 2025-11-03 15:54:40 +08:00 committed by GitHub
commit 53ee24f828
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -128,6 +128,9 @@ async def sendAudio(conn, audios, frame_duration=60):
delay = expected_time - current_time
if delay > 0:
await asyncio.sleep(delay)
else:
# 纠正误差
flow_control["start_time"] += abs(delay)
if conn.conn_from_mqtt_gateway:
# 计算时间戳和序列号