6 changed files with 35 additions and 114 deletions
-
5CMakeLists.txt
-
27TODO.md
-
5cmakepc.cmake
-
2dep/zclipp
-
2dep/zlinuxcomponents
-
108src/test_aiui_service.cpp
@ -1,2 +1,27 @@ |
|||
1. 整理aiui测试代码中的appid,使用测试项目的appid |
|||
2. 将应用程序中的aiui的appid修改成配置 |
|||
2. 将应用程序中的aiui的appid修改成配置 |
|||
|
|||
|
|||
|
|||
------------------------------------------------------------------- |
|||
|
|||
|
|||
7. 将aiui的配置,设备ID的配置,唤醒词的配置,是否记录语音的配置导出,通过config.hpp进行配置 |
|||
8. 使用最新的黑板进行测试 |
|||
5. 烧录stm32程序,测试主机和stm32之间的通信 |
|||
9. 重构工程的Cmake文件,和iflytool.sh文件 |
|||
10. 将AIUI的配置写活,在飞书中添加相关第三方服务使用说明手册和注意事项 |
|||
12. 创建一个aiui的项目,专门用于工程中的测试代码使用,并修改其配置,添加注释,写好使用时应该参考的文档。 |
|||
|
|||
6. 编写内核编译说明,和具体项目的内核编译说明 |
|||
1. 打包最终包操作系统,为其增加自动保存网卡的功能,去掉内核中的这个功能。 |
|||
2. 编写导出文件系统方案和注意事项。 |
|||
3. 实现一份通用的文件系统,而非灯杆项目专用文件系统。 |
|||
12. 设备开机时,自动打开 |
|||
13. 对当前这个版本的内核写应用使用说明 |
|||
14. 设备ID |
|||
15. 尝试加入降噪,AGC功能。 |
|||
|
|||
------------------------------------------------------------------- |
|||
|
|||
|
@ -1 +1 @@ |
|||
Subproject commit 2c32b2f1f7cc530b1ec1f62c92f698643bb368db |
|||
Subproject commit ccc2ef839b360b703e5febba8a6ab29c882d0818 |
@ -1 +1 @@ |
|||
Subproject commit c1eac4f961ff27d8cc4c3f1ddfa985be40750e9d |
|||
Subproject commit 938de9936e25f18ce7e07906dfc1bb9937ad231f |
@ -1,108 +0,0 @@ |
|||
#include "zlinuxcomponents/zmainhelper.hpp"
|
|||
//
|
|||
#include "configs/zconfig.hpp"
|
|||
#include "iflytopcpp/core/spdlogfactory/logger.hpp"
|
|||
#include "iflytopcpp/core/thread/thread.hpp"
|
|||
#include "spdlog/spdlog.h"
|
|||
#include "version.hpp"
|
|||
#include "zlinuxcomponents/rootfs_auto_update/rootfs_auto_update.hpp"
|
|||
#include "zservice_container/zservice_container.hpp"
|
|||
//
|
|||
#include "service/device_io_service.hpp"
|
|||
#include "service/device_io_service_mock.hpp"
|
|||
#include "service/light_control_service.hpp"
|
|||
#include "service/report_service.hpp"
|
|||
#include "zlinuxcomponents/aiui_ws/aiui_service.hpp"
|
|||
|
|||
//
|
|||
#include "zlinuxcomponents/alsaplayer/AudioPlayerAlsaImpl.hpp"
|
|||
// #include "zlinuxcomponents/audio/audio_recoder.hpp"
|
|||
#include <curl/curl.h>
|
|||
|
|||
#include <iostream>
|
|||
#include <string>
|
|||
|
|||
#include "zlinuxcomponents/aiui_ws/aiui.h"
|
|||
|
|||
//
|
|||
using namespace iflytop; |
|||
using namespace core; |
|||
using namespace std; |
|||
using namespace clipp; |
|||
|
|||
ZMAIN(); |
|||
void Main::onSIGINT() { exit(0); } |
|||
int Main::main(int argc, char *argv[]) { |
|||
string g_host_server_ip; |
|||
string g_device_id; |
|||
spdlog::flush_on(spdlog::level::debug); |
|||
|
|||
const char *appid = "5938b7c7"; // 应用ID,在AIUI开放平台创建并设置
|
|||
const char *key = "19c1f7becc78eedc7826b485aabe30de"; // 接口密钥,在AIUI开放平台查看
|
|||
const char *param = |
|||
"{\"result_level\":\"plain\",\"auth_id\":\"ac30105366ea460f9ff08ddac0c4f71e\",\"data_" |
|||
"type\":\"text\"," |
|||
"\"scene\":\"main_box\",\"sample_rate\":\"16000\", " |
|||
"\"context\":\"{\\\"sdk_support\\\":[\\\"nlp\\\",\\\"tts\\\"]}\"}"; |
|||
|
|||
json paramj; |
|||
paramj["result_level"] = "plain"; |
|||
paramj["auth_id"] = "ac30105366ea460f9ff08ddac0c4f71e"; |
|||
paramj["data_type"] = "text"; |
|||
paramj["scene"] = "main_box"; |
|||
paramj["sample_rate"] = "16000"; |
|||
paramj["context"] = R"({"sdk_support":["nlp","tts","vad","iat"]})"; |
|||
// logger->info("{}", paramj.dump());
|
|||
// logger->info("{}", param);
|
|||
|
|||
shared_ptr<AiuiService> aiuiService(new AiuiService()); |
|||
logger->info("test_asr_main.cpp"); |
|||
aiuiService->initialize(appid, key, paramj.dump()); |
|||
aiuiService->aiuiInit(); |
|||
aiuiService->onMessage.connect([&](json &rxjson) { |
|||
//
|
|||
string action = rxjson["action"]; |
|||
if (action == "started") { |
|||
logger->info("rx started:{}", rxjson.dump()); |
|||
} |
|||
//
|
|||
else if (action == "result") { |
|||
string sub = rxjson["data"]["sub"]; |
|||
if (sub == "nlp") { |
|||
logger->info("rx nlp:{}", rxjson.dump()); |
|||
} else if (sub == "tts") { |
|||
logger->info("rx tts:frame {}", rxjson["data"]["json_args"]["frame_id"].get<int>()); |
|||
bool isendFrame = false; |
|||
string ttsurl; |
|||
aiuiService->parseTTSContent(rxjson, isendFrame, ttsurl); |
|||
if (isendFrame) { |
|||
logger->info("rx tts end,url={}", ttsurl); |
|||
} |
|||
} else if (sub == "iat") { |
|||
logger->info("rx iat:{}", rxjson.dump()); |
|||
} else if (sub == "vad") { |
|||
logger->info("rx vad:{}", rxjson.dump()); |
|||
} else { |
|||
logger->info("rx {}:{}", sub, rxjson.dump()); |
|||
} |
|||
} |
|||
//
|
|||
else if (action == "error") { |
|||
logger->info("rx error:{}", rxjson.dump()); |
|||
} |
|||
//
|
|||
else if (action == "vad") { |
|||
} else { |
|||
logger->info("rx unkown:{}", rxjson.dump()); |
|||
} |
|||
|
|||
try { |
|||
if (rxjson["data"]["is_finish"].get<bool>()) { |
|||
logger->info("end tx"); |
|||
} |
|||
} catch (...) { |
|||
} |
|||
}); |
|||
aiuiService->aiuiWrite("今天天气怎么样", strlen("今天天气怎么样")); |
|||
while (true) sleep(1000); |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue