mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-24 04:19:48 +01:00
Merge pull request #2455 from xinnan-tech/py_fix_packet
fix: 等待音频过长时需修正包状态
This commit is contained in:
commit
53ee24f828
1 changed files with 3 additions and 0 deletions
|
|
@ -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:
|
||||
# 计算时间戳和序列号
|
||||
|
|
|
|||
Loading…
Reference in a new issue