Merge pull request #629 from joey-zhou/vad_optimize

优化vad,采用bytearray替换byte,提高字符串拼接效率
This commit is contained in:
hrz
2025-04-04 18:39:16 +08:00
committed by GitHub
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