update:长按说话不走VAD直接触发ASR识别

This commit is contained in:
FAN-yeB
2025-12-09 14:42:50 +08:00
parent 401deff2c3
commit 60521b0a7e
3 changed files with 26 additions and 9 deletions
@@ -45,6 +45,10 @@ class VADProvider(VADProviderBase):
pass
def is_vad(self, conn, opus_packet):
# 手动模式:直接返回True,不进行实时VAD检测,所有音频都缓存
if conn.client_listen_mode not in ["auto", "realtime"]:
return True
try:
pcm_frame = self.decoder.decode(opus_packet, 960)
conn.client_audio_buffer.extend(pcm_frame) # 将新数据加入缓冲区