mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 18:23:59 +08:00
fix:高并发下,共享vad里decoder变量扰动
This commit is contained in:
@@ -1119,6 +1119,14 @@ class ConnectionHandler:
|
||||
async def close(self, ws=None):
|
||||
"""资源清理方法"""
|
||||
try:
|
||||
# 清理 VAD 连接资源
|
||||
if (
|
||||
hasattr(self, "vad")
|
||||
and self.vad
|
||||
and hasattr(self.vad, "release_conn_resources")
|
||||
):
|
||||
self.vad.release_conn_resources(self)
|
||||
|
||||
# 清理音频缓冲区
|
||||
if hasattr(self, "audio_buffer"):
|
||||
self.audio_buffer.clear()
|
||||
|
||||
Reference in New Issue
Block a user