mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 10:03:54 +08:00
update:将垃圾回收放置ws关闭处,避免频繁操作
This commit is contained in:
@@ -133,6 +133,5 @@ class OpusEncoderUtils:
|
||||
try:
|
||||
del self.encoder
|
||||
self.encoder = None
|
||||
gc.collect()
|
||||
except Exception as e:
|
||||
logging.error(f"Error releasing Opus encoder: {e}")
|
||||
@@ -398,7 +398,6 @@ def opus_datas_to_wav_bytes(opus_datas, sample_rate=16000, channels=1):
|
||||
if decoder is not None:
|
||||
try:
|
||||
del decoder
|
||||
gc.collect()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user