* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-07-31 11:45:08
+ * @LastEditTime: 2025-03-07 09:26:23
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceReturnResultTextView.h
*/
AivoiceChatContentListAdapter *GetAivoiceChatContentListAdapter(void);
UIList *GetChatContentList(void);
void UpdateTitleTextId(int textId);
+ void IsScrollChatContentList(bool isScroll);
private:
void ClearAll(void);
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:14:50
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-02-18 14:48:15
+ * @LastEditTime: 2025-03-07 10:14:18
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
*/
#include "aivoice/include/AiVoiceModel.h"
{
// 声明定时器变量
static osTimerId_t g_timer = nullptr;
- static constexpr uint16_t THIRTY_TIME = 31;
+ static constexpr uint16_t THIRTY_TIME = 30;
static int Time = THIRTY_TIME;
static int AiModelConnectTimeout = 5;
/*清空上次用户问题和Ai回答字符串*/
void AiVoiceModel::ClearQuestionAndAiAnswerStr(void)
{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "清空上次用户问题和Ai回答字符串");
userQuestionStr = "";
aiAnswerStr = "";
}
#endif
int32_t AudioCaptureSample(int32_t argc, const char *argv[]);
int32_t streamingRecordAndSend_AI(void);
- #define IS_SUPPORT_REALTIME_RECORD_SEND_AI 1
+ #define IS_SUPPORT_REALTIME_RECORD_SEND_AI 1 //是否支持实时发送录音数据
#ifdef __cplusplus
};
#endif
// 开始聆听并录取用户问题
void AiVoiceModel::StartListenAndRecordingUserQuestion(void)
{
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::StartListenAndRecordingUserQuestion");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "聆听用户问题并发送录音数据");
AiVoiceView *view_ = AiVoiceView::GetInstance();
if (view_ == nullptr)
{
// 停止聆听用户问题
void AiVoiceModel::StopListenAndRecordingUserQuestion(void)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::StopListenAndRecordingUserQuestion");
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "停止录音");
int32_t argc = 1;
uint8_t *argv = (uint8_t *)"stop";
AudioCaptureSample(argc, (const char **)&argv);
{
// 等待AI思考完成的定时器
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AIVoice_TimerCallbackProc,Time = %d", Time);
- if (Time == 30) // 等待一秒,确保录音停止,发送录音准备就绪指令
- {
- // AiVoiceModel::GetInstance().CheckFileAndSendAIIsReady();
- }
if (Time < 0) // 如果思考时间超时30s,进入连接超时界面
{
AiVoiceModel::GetInstance().AIVoice_StopTimer();
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:11:17
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-11-19 22:08:14
+ * @LastEditTime: 2025-03-06 16:10:32
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
*/
#include "AppViewIDs.h"
break;
case AIVOICE_RETURN_RESULT_TEXT_VIEWID:
+ AiVoiceModel::GetInstance().ClearQuestionAndAiAnswerStr(); // 清空上次用户问题和Ai回答字符串
if (showView == AIVOICE_LISTENING_VIEWID)
{
model->StartListenAndRecordingUserQuestion();
return true;
}
+ // 处理手点击屏幕切换AI模型
bool AiVoicePresenter::OnClick(UIView &view, const ClickEvent &event)
{
UNUSED(event);
if (it->first == AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID) // 点击继续对话按钮要发取消当前对话指令,避免AI回应中途按继续对话按钮没有取消上一次对话问题
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CancelCurAIChat");
- AiVoiceModel::GetInstance().ClearQuestionAndAiAnswerStr(); // 清空上次用户问题和Ai回答字符串
AiVoiceModel::GetInstance().CancelCurAIChat();
PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐
PlayersModel::GetInstance()->PlayerPause(); // 暂停手机音乐
ChangeViewAndLogicOperator(it->second.first, it->second.second);
return true;
}
- else
- {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Return false if viewId doesn't match any entry in the map");
- return false;
- }
return true;
}
ChangeViewAndLogicOperator(it->second.first, it->second.second);
return true;
}
- else
- {
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Return false if viewId doesn't match any entry in the map");
- return false;
- }
return true;
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-02-28 15:44:14
+ * @LastEditTime: 2025-03-06 16:07:08
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-03-03 11:48:01
+ * @LastEditTime: 2025-03-07 09:54:21
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceReturnResultTextView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
}
}
}
+
+ void AivoiceReturnResultTextView::IsScrollChatContentList(bool isScroll)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AivoiceReturnResultTextView::IsScrollChatContentList");
+ if (isScroll)
+ {
+ scrollView->RequestFocus();
+ chatContentList->SetTouchable(false);
+ chatContentList->SetDraggable(false);
+ }
+ else
+ {
+ chatContentList->RequestFocus();
+ chatContentList->SetTouchable(true);
+ chatContentList->SetDraggable(true);
+ }
+ }
}
\ No newline at end of file
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"ble_recv:end\r\n");\r
}\r
}\r
-#define BLESRV_APP_BOARD_MSG_COUNT 500\r
+#define BLESRV_APP_BOARD_MSG_COUNT 256\r
#define BLESRV_APP_BOARD_TASK_SIZE 0x2000\r
#define BLESRV_BOARD_TASK_PRIO 7\r
void create_blesrv_queue(void)\r
taskcfg.create_queue_handle = create_Ai_record_queue;\r
taskcfg.attr.name = "Ai_record_queue_service";\r
taskcfg.attr.priority = osPriorityNormal;\r
- taskcfg.attr.stack_size = BLESRV_APP_BOARD_TASK_SIZE;\r
+ // taskcfg.attr.stack_size = BLESRV_APP_BOARD_TASK_SIZE;\r
+ taskcfg.attr.stack_size = 0x800;\r
taskcfg.func = blesrvAi_send_service_task;\r
taskcfg.use_mem = USE_EXTEND_MEM;\r
\r