From 7788e939f28d3b0caeaa9ebbd16b07d9d9b2e53e Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 19 Jul 2025 18:18:11 +0800 Subject: [PATCH] =?utf8?q?1.=E8=A7=A3=E5=86=B3deepseek=E5=9B=9E=E5=BA=94?= =?utf8?q?=E6=85=A2=E9=97=AE=E9=A2=98=202.=E8=A7=A3=E5=86=B34G=E7=BD=91?= =?utf8?q?=E7=BB=9CAI=20=20=20=E6=89=80=E6=9C=89AI=20=20=E8=AF=A2=E9=97=AE?= =?utf8?q?=E9=97=AE=E9=A2=98=E5=90=8E=EF=BC=8CAI=E5=9C=A8=E5=9B=9E?= =?utf8?q?=E7=AD=94=E9=97=AE=E9=A2=98=E6=97=B6=E5=80=99=E4=B8=AD=E6=96=AD?= =?utf8?q?=EF=BC=8C=E8=BF=9B=E8=A1=8C=E4=B8=8B=E4=B8=80=E4=B8=AA=E9=97=AE?= =?utf8?q?=E9=A2=98=EF=BC=8C=E5=9B=9E=E7=AD=94=E7=9A=84=E8=BF=98=E6=98=AF?= =?utf8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/aivoice/include/AiVoiceModel.h | 4 +++- .../fd230app/nativeui/aivoice/src/AiVoiceModel.cpp | 12 +++++++++++- .../fd230app/nativeui/aivoice/src/AiVoiceView.cpp | 4 ++-- .../peripheral/slip/cat1Service/cat1_ai_server.cpp | 13 +++++-------- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h index 2809b0734..c6d09c61d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h @@ -22,7 +22,7 @@ #define CURRENT_AIAUDIO_TYPE AIAUDIO_TYPE_SBC #if defined(SUPPORT_CHINA_MOBILE_DMP) || defined(SUPPORT_CHINA_MOBILE_AI_REGULATION) - #define AI_VOICE_JIUTIAN // 九天版本 + #define AI_VOICE_FD230 // 九天版本 #elif defined(BOARD_N9) #define AI_VOICE_N9 //N9 星辰Ai #else @@ -156,6 +156,8 @@ namespace OHOS std::string GetAccumulatedText(void); void sendSegment(const std::string &text, size_t pos); + static bool cur_ai_4g_answer_update; + private: AiVoiceModel(); ~AiVoiceModel(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index 8cd0d07c2..f151a90e8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -1676,6 +1676,7 @@ namespace OHOS static osTimerId_t g_start_ai_answer_update_Handle = nullptr; static constexpr const int8_t NUMBER_THREE = 3; static int8_t START_UPDATE_AIANSWER_CNT = NUMBER_THREE; + bool AiVoiceModel::cur_ai_4g_answer_update = false; static void AI4G_START_AI_ANSWER_CallbackProc(int data) { START_UPDATE_AIANSWER_CNT--; @@ -1685,7 +1686,15 @@ namespace OHOS } else { - AiVoiceModel::GetInstance().UpdateAiAnswerStr(); + if(!AiVoiceModel::cur_ai_4g_answer_update) + { + AiVoiceModel::cur_ai_4g_answer_update = true; + if(AiVoiceModel::GetInstance().UpdateAiAnswerStr()) + { + AiVoiceModel::cur_ai_4g_answer_update = false; + LOS_Msleep(10); + } + } } } @@ -1745,6 +1754,7 @@ namespace OHOS } g_start_ai_answer_update_Handle = nullptr; START_UPDATE_AIANSWER_CNT = NUMBER_THREE; + AiVoiceModel::cur_ai_4g_answer_update = false; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp index 790248886..c14874408 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp @@ -438,7 +438,7 @@ namespace OHOS aiModelPicker->SetStyle(STYLE_BORDER_RADIUS, 150); aiModelPicker->SetItemHeight(40); aiModelPicker->SetLoopState(true); -#if defined(AI_VOICE_JIUTIAN) || defined(AI_VOICE_N9) +#if defined(AI_VOICE_FD230) || defined(AI_VOICE_N9) #else aiModelPicker->SetRotateFactor(1.0); aiModelPicker->RequestFocus(); @@ -546,7 +546,7 @@ namespace OHOS container_->SetOnClickListener(presenter_); ChangeView(MAX_AIVOICE_VIEWID, AIVOICE_STARTCHAT_VIEWID); -#if defined(AI_VOICE_JIUTIAN) || defined(AI_VOICE_N9) +#if defined(AI_VOICE_FD230) || defined(AI_VOICE_N9) CreateAiVoiceVoiceView(); #endif 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 033eae4df..7c24fe1ce 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp @@ -133,14 +133,11 @@ void uapi_UI_start_asr(uint8_t type) // uapi_stop_tts(); - if(type_ai!=type) + type_ai=type; + if(chat_client) { - type_ai=type; - if(chat_client) - { - chat_server_deinit(); - chat_reconnect=1; - } + chat_server_deinit(); + chat_reconnect=1; } @@ -442,7 +439,7 @@ void bk_websocket_demo(void *data) { } else if(type_ai==AI_TYPE_DE) { - chat_client = init_websocket_client("ws://118.145.158.207:22080/chat/ws?platform=huoshan&model=ep-20250206162546-g74w6",NULL,0); + chat_client = init_websocket_client("ws://118.145.158.207:22080/chat/ws?platform=huoshan&model=ep-20250205103849-582m7",NULL,0); } else { -- 2.17.1