mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 10:03:54 +08:00
chore(server): 移除高频触发的debug日志输出
This commit is contained in:
@@ -314,7 +314,7 @@ class ConnectionHandler:
|
|||||||
break
|
break
|
||||||
|
|
||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
self.logger.bind(tag=TAG).debug(f"大模型返回时间: {end_time - start_time} 秒, 生成token={content}")
|
# self.logger.bind(tag=TAG).debug(f"大模型返回时间: {end_time - start_time} 秒, 生成token={content}")
|
||||||
|
|
||||||
# 合并当前全部文本并处理未分割部分
|
# 合并当前全部文本并处理未分割部分
|
||||||
full_text = "".join(response_message)
|
full_text = "".join(response_message)
|
||||||
@@ -433,7 +433,7 @@ class ConnectionHandler:
|
|||||||
break
|
break
|
||||||
|
|
||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
self.logger.bind(tag=TAG).debug(f"大模型返回时间: {end_time - start_time} 秒, 生成token={content}")
|
# self.logger.bind(tag=TAG).debug(f"大模型返回时间: {end_time - start_time} 秒, 生成token={content}")
|
||||||
|
|
||||||
# 处理文本分段和TTS逻辑
|
# 处理文本分段和TTS逻辑
|
||||||
# 合并当前全部文本并处理未分割部分
|
# 合并当前全部文本并处理未分割部分
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ logger = setup_logging()
|
|||||||
|
|
||||||
async def handleAudioMessage(conn, audio):
|
async def handleAudioMessage(conn, audio):
|
||||||
if not conn.asr_server_receive:
|
if not conn.asr_server_receive:
|
||||||
logger.bind(tag=TAG).debug(f"前期数据处理中,暂停接收")
|
# logger.bind(tag=TAG).debug(f"前期数据处理中,暂停接收")
|
||||||
return
|
return
|
||||||
if conn.client_listen_mode == "auto":
|
if conn.client_listen_mode == "auto":
|
||||||
have_voice = conn.vad.is_vad(conn, audio)
|
have_voice = conn.vad.is_vad(conn, audio)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ async def sendAudio(conn, audios):
|
|||||||
pre_buffer = min(3, len(audios))
|
pre_buffer = min(3, len(audios))
|
||||||
for i in range(pre_buffer):
|
for i in range(pre_buffer):
|
||||||
await conn.websocket.send(audios[i])
|
await conn.websocket.send(audios[i])
|
||||||
conn.logger.bind(tag=TAG).debug(f"预缓冲帧 {i}, 时间: {(time.perf_counter() - start_time) * 1000:.2f}ms")
|
# conn.logger.bind(tag=TAG).debug(f"预缓冲帧 {i}, 时间: {(time.perf_counter() - start_time) * 1000:.2f}ms")
|
||||||
|
|
||||||
# 正常播放剩余帧
|
# 正常播放剩余帧
|
||||||
for opus_packet in audios[pre_buffer:]:
|
for opus_packet in audios[pre_buffer:]:
|
||||||
@@ -51,7 +51,7 @@ async def sendAudio(conn, audios):
|
|||||||
await asyncio.sleep(delay)
|
await asyncio.sleep(delay)
|
||||||
|
|
||||||
await conn.websocket.send(opus_packet)
|
await conn.websocket.send(opus_packet)
|
||||||
conn.logger.bind(tag=TAG).debug(f"发送帧,位置: {play_position}ms, 实际间隔: {(time.perf_counter() - current_time) * 1000:.2f}ms")
|
# conn.logger.bind(tag=TAG).debug(f"发送帧,位置: {play_position}ms, 实际间隔: {(time.perf_counter() - current_time) * 1000:.2f}ms")
|
||||||
|
|
||||||
play_position += frame_duration
|
play_position += frame_duration
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user