From: hcj <1224667075@qq.com> Date: Thu, 11 Jul 2024 04:03:02 +0000 (+0800) Subject: 改为UI路径接口 X-Git-Tag: release_V1.2.70_20241020_135402~831^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F500%2F3;p=mirrors%2FFD230.git 改为UI路径接口 --- diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index 900283abc..01520124a 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -87,6 +87,14 @@ void ble_set_ai_Answer_str(char *buf) OHOS::AiVoiceModel::GetInstance().SetAiAnswerStrStr(std::string(buf)); } +char* ble_get_ai_audio_path_str(void) +{ + return (char *)OHOS::AiVoiceModel::GetInstance().GetAIAudioPath().c_str(); +} + + + + uint8_t ble_get_heart_data() { OHOS::HeartRateData *data=(OHOS::HeartRateData*)malloc(sizeof(OHOS::HeartRateData)); @@ -164,41 +172,6 @@ cJSON* ble_get_recs_data() return data_arryJSON; } -// { -// "type":3, -// "list":[ -// { -// "uid":3758, -// "name":"plate_3758.bin", -// "size":129600 -// }, -// { -// "uid":3759, -// "name":"plate_3759.bin", -// "size":129600 -// } -// ] -// } -// 注:MP3文件目录格式 -// { -// "type":2, -// "list": [ -// { -// "uid":2461, //指定唯一编号,便于APP发送编号删除文件 -// "name":"夜曲.mp3", -// "size":3894464, -// "artist":"周杰伦", -// "dur":223000 //歌曲时长,单位毫秒 -// }, -// { -// "uid":2465, //指定唯一编号,便于APP发送编号删除文件 -// "name":"告白气球.mp3", -// "size":3894464, -// "artist":"周杰伦", -// "dur":223000 //歌曲时长,单位毫秒 -// } -// ] -// } Tag_Trailer_t Mp3Trailer; Tag_ID3V2_TAG_T TAG_T; diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h index 8d7f2098f..c9f65d3bf 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h @@ -261,6 +261,8 @@ void ble_set_ai_Question_str(char *buf); void ble_set_ai_Answer_str(char *buf); +char* ble_get_ai_audio_path_str(void); + /////////////////////////////MP3相关///////////////////////// typedef struct Tag_Trailer diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index b8b2102de..972a7bd1f 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -3903,19 +3903,13 @@ static void GetPasswordCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *tota } } -#ifdef AI_USE_PCM -#define AI_RECORD_PCM_PATH "/user/userdata/AiRecording/AIAudio.pcm" -#else -#define AI_RECORD_SBC_PATH "/user/userdata/AiRecording/AIAudio.msbc" -#endif + bool get_AI_PATH_and_size(char *path,uint32_t *size) { - #ifdef AI_USE_PCM - memcpy((void*)path,AI_RECORD_PCM_PATH,strlen(AI_RECORD_PCM_PATH)); - #else - memcpy((void*)path,AI_RECORD_SBC_PATH,strlen(AI_RECORD_SBC_PATH)); - #endif + + memcpy((void*)path,ble_get_ai_audio_path_str(),strlen(ble_get_ai_audio_path_str())); + FILE *fp= fopen(path,"r+"); if(fp) {