From ca6276c6092665854c41a3f7d973fa04efb4f68f Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 28 Jun 2025 17:39:29 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9UI=E4=BD=BF=E7=94=A8=E6=8E=A5?= =?utf8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/aivoice/src/AiVoiceModel.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 cca2e5473..0c67ae153 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -174,7 +174,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetSelect4gorbt() == AI_SELECT_4G"); if (GetInit_4gai_task()) { - uapi_start_asr(); + uapi_UI_start_asr(); } else { @@ -677,7 +677,10 @@ namespace OHOS if (GetSelect4gorbt() == AI_SELECT_4G) // 选的是4G需要关闭asr { // uapi_stop_asr(); - stop_AudioCaptureProcess_AI(); + // stop_AudioCaptureProcess_AI(); + uapi_UI_stop_asr(); + + } else if (GetSelect4gorbt() == AI_SELECT_BT) { @@ -1158,7 +1161,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "4gAi服务初始化成功"); bool state = true; SendMsgToUIService(UI_4G_AI_INIT_STAUS, 0, &state, sizeof(bool)); - uapi_start_asr(); + uapi_UI_start_asr(); AiVoiceModel::GetInstance().stop_ai4g_connect_timer(); p_AiVoicePresenter->ChangeViewAndLogicOperator(AIVOICE_4GSERVICECON_VIEW, AIVOICE_AIMODE_CONNECTING); } @@ -1212,7 +1215,7 @@ namespace OHOS // 检查定时器是否存在 if (g_ai4g_is_suc_connected_Handle != nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::stop_ai4g_connect_timer"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::stop_ai_isready_timer"); osTimerStop(g_ai4g_is_suc_connected_Handle); // 删除定时器并置为 nullptr osStatus_t ret = osTimerDelete(g_ai4g_is_suc_connected_Handle); @@ -1256,7 +1259,7 @@ namespace OHOS void AiVoiceModel::start_ai4g_tts_play_timer(uint32_t interval) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::start_ai_isready_timer"); - AI4G_IS_START_TTS_PLAY_TIME = 1; + AI4G_IS_START_TTS_PLAY_TIME = 3; /* -------------------------- 1.检查定时器是否已经存在,如果存在则返回 ------------------------- */ if (g_ai4g_is_start_tts_play_Handle != nullptr) { @@ -1294,7 +1297,7 @@ namespace OHOS // 检查定时器是否存在 if (g_ai4g_is_start_tts_play_Handle != nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::stop_ai4g_tts_play_timer"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::stop_ai_isready_timer"); osTimerStop(g_ai4g_is_start_tts_play_Handle); // 删除定时器并置为 nullptr osStatus_t ret = osTimerDelete(g_ai4g_is_start_tts_play_Handle); -- 2.17.1