{
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())
{
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);//先跳转到结果界面
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) //可以对话了,切换到聆听界面