改为UI路径接口 500/3 500/head 501/target/1
authorhcj <1224667075@qq.com>
Thu, 11 Jul 2024 04:03:02 +0000 (12:03 +0800)
committerhcj <1224667075@qq.com>
Thu, 11 Jul 2024 04:03:02 +0000 (12:03 +0800)
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.h
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c

index 900283a..0152012 100644 (file)
@@ -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;
 
index 8d7f209..c9f65d3 100644 (file)
@@ -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
index b8b2102..972a7bd 100644 (file)
@@ -3903,19 +3903,13 @@ static void GetPasswordCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *tota
     }\r
 }\r
 \r
-#ifdef AI_USE_PCM\r
-#define AI_RECORD_PCM_PATH "/user/userdata/AiRecording/AIAudio.pcm"\r
-#else\r
-#define AI_RECORD_SBC_PATH "/user/userdata/AiRecording/AIAudio.msbc"\r
-#endif\r
+\r
 \r
 bool get_AI_PATH_and_size(char *path,uint32_t *size)\r
 {\r
-    #ifdef AI_USE_PCM\r
-    memcpy((void*)path,AI_RECORD_PCM_PATH,strlen(AI_RECORD_PCM_PATH));\r
-    #else\r
-     memcpy((void*)path,AI_RECORD_SBC_PATH,strlen(AI_RECORD_SBC_PATH));\r
-    #endif\r
+\r
+    memcpy((void*)path,ble_get_ai_audio_path_str(),strlen(ble_get_ai_audio_path_str()));\r
+\r
     FILE *fp= fopen(path,"r+");\r
     if(fp)\r
     {\r