From 98cbc1de60361a730bfdbf0fac40e302093719d3 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Tue, 22 Jul 2025 15:31:53 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0asr=E6=8B=A6=E6=88=AA=20UI?= =?utf8?q?=E6=9C=89bug=E9=9C=80=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../slip/cat1Service/cat1_ai_server.cpp | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp index 619cb1647..ff6c82cba 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp @@ -177,18 +177,23 @@ void uapi_UI_stop_start_asr_timeout(void) { asr_need_stop=1; } +#if 0 +#define ASR_HODE +#endif void uapi_UI_stop_asr(void) { - // SendMsgToUIService(UI_AI_JUMP_TO_RESULT_VIEW, 0, nullptr, 0);//先跳转到结果界面 + #ifdef ASR_HODE + SendMsgToUIService(UI_AI_JUMP_TO_RESULT_VIEW, 0, nullptr, 0);//先跳转到结果界面 - // if(strlen(result_str_asr)) - // { - // send_ai_txt(0,result_str_asr); - // ble_set_ai_Question_str(result_str_asr); + if(strlen(result_str_asr)) + { + send_ai_txt(0,result_str_asr); + ble_set_ai_Question_str(result_str_asr); - // memset_s(result_str_asr,AI_RESULT_STR_LEN,0,AI_RESULT_STR_LEN); - // } + memset_s(result_str_asr,AI_RESULT_STR_LEN,0,AI_RESULT_STR_LEN); + } + #endif if(stop_AudioCaptureProcess_AI()) { @@ -713,6 +718,10 @@ bool aer_result_analysis(char *buf) if(is_end_bool==true) { + + #ifdef ASR_HODE + memcpy_s(&result_str_asr[strlen(result_str_asr)],AI_RESULT_STR_LEN/2,result_str,strlen(result_str)); + #else memset_s(result_str_asr,256,0,256); memcpy_s(result_str_asr,256,result_str,strlen(result_str)); SendMsgToUIService(UI_AI_JUMP_TO_RESULT_VIEW, 0, nullptr, 0);//先跳转到结果界面 @@ -720,6 +729,7 @@ bool aer_result_analysis(char *buf) ble_set_ai_Question_str(result_str_asr); // stop_AudioCaptureProcess_AI(); send_ai_txt(0,result_str_asr); + #endif } if(strcmp(event_str,"TranscriptionStarted")==0) //可以对话了,切换到聆听界面 -- 2.17.1