优化vad,采用bytearray替换byte,提高字符串拼接效率

This commit is contained in:
JoeyZhou
2025-04-01 22:47:15 +08:00
parent 97b777f1b2
commit 132174568f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ class SileroVAD(VAD):
def is_vad(self, conn, opus_packet):
try:
pcm_frame = self.decoder.decode(opus_packet, 960)
conn.client_audio_buffer += pcm_frame # 将新数据加入缓冲区
conn.client_audio_buffer.extend(pcm_frame) # 将新数据加入缓冲区
# 处理缓冲区中的完整帧(每次处理512采样点)
client_have_voice = False