减少日志打印

This commit is contained in:
xiehao.0527 2025-07-14 15:30:11 +08:00
parent 419b0fbbec
commit 78442180c3

View file

@ -13,7 +13,8 @@ TAG = __name__
async def handleAudioMessage(conn, audio):
# 当前片段是否有人说话
have_voice = conn.vad.is_vad(conn, audio)
conn.logger.bind(tag=TAG).info(f"收到音频数据,have_voice: {have_voice},len: {len(audio)}")
if have_voice:
conn.logger.bind(tag=TAG).info(f"收到音频数据,len: {len(audio)}, wake_up: {conn.just_woken_up}")
# 如果设备刚刚被唤醒,短暂忽略VAD检测
if have_voice and hasattr(conn, "just_woken_up") and conn.just_woken_up:
have_voice = False