Files
QingLong/XiaoZhi/文档/技术文档分析.txt
2025-08-15 09:13:13 +08:00

31 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1、ASR
D:\dsWork\QingLong\XiaoZhi\xiaozhi-esp32-server\main\xiaozhi-server\core\handle\receiveAudioHandle.py
在第12行大约这个位置下断点可以跟踪到流程
async def handleAudioMessage(conn, audio):
if not conn.asr_server_receive:
某些场景下在38行下断点可以拦截到内容
if conn.client_voice_stop:
conn.client_abort = False
conn.asr_server_receive = False
# 音频太短了,无法识别
if len(conn.asr_audio) < 15:
conn.asr_server_receive = True
else:
text, file_path = await conn.asr.speech_to_text(
conn.asr_audio, conn.session_id
)
跟踪进入
D:\dsWork\QingLong\XiaoZhi\xiaozhi-esp32-server\main\xiaozhi-server\core\providers\asr\fun_local.py
76行
async def speech_to_text(self, opus_data: List[bytes], session_id: str) -> Tuple[Optional[str], Optional[str]]:
"""语音转文本主处理逻辑"""
file_path = None
try:
准备在第97行嵌入代码
#【黄海注释】准备在这里进行嵌入代码,把文字+声音的关系记录下来,让用户选择是哪个人进行声纹匹配
return text, file_path