Merge pull request #1703 from xinnan-tech/py_websoket_link

fix: 退出过快问题
This commit is contained in:
CGD
2025-06-27 17:26:38 +08:00
committed by GitHub
2 changed files with 5 additions and 11 deletions
@@ -92,10 +92,8 @@ async def sendAudio(conn, audios, pre_buffer=True):
if conn.client_abort:
break
# 每分钟重置一次计时器
if time.perf_counter() - last_reset_time > 60:
await conn.reset_timeout()
last_reset_time = time.perf_counter()
# 重置没有声音的状态
conn.client_no_voice_last_time = 0.0
# 计算预期发送时间
expected_time = start_time + (play_position / 1000)