From: hcj <1224667075@qq.com> Date: Tue, 22 Jul 2025 07:31:53 +0000 (+0800) Subject: 增加asr拦截 UI有bug需修改 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=98cbc1de60361a730bfdbf0fac40e302093719d3;p=mirrors%2FFD230.git 增加asr拦截 UI有bug需修改 --- 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) //可以对话了,切换到聆听界面