/************************************************************************************************** * * Copyright (c) 2019-2026 Axera Semiconductor (Ningbo) Co., Ltd. All Rights Reserved. * * This source file is the property of Axera Semiconductor (Ningbo) Co., Ltd. and * may not be copied or distributed in any isomorphic form without the prior * written consent of Axera Semiconductor (Ningbo) Co., Ltd. * **************************************************************************************************/ #include "tts_server.hpp" #include "utils/cmdline.hpp" #include "utils/logger.h" #include int main(int argc, char** argv) { cmdline::parser cmd; cmd.add("port", 'p', "On which port to run the server", false, 8080); #if defined(CHIP_AX650) || defined(CHIP_AX8850) cmd.add("model_path", 'm', "model path which contains axmodel", false, "./models-ax650"); #else cmd.add("model_path", 'm', "model path which contains axmodel", false, "./models-ax630c"); #endif cmd.add("espeak_data_path", 0, "Path to espeak-ng-data directory", false, ""); cmd.add("jieba_dict_path", 0, "Path to jieba dict directory", false, ""); cmd.parse_check(argc, argv); // 0. get app args, can be removed from user's app auto port = cmd.get("port"); auto model_path = cmd.get("model_path"); auto espeak_data_path = cmd.get("espeak_data_path"); auto jieba_dict_path = cmd.get("jieba_dict_path"); TTSServer server; if (!server.init(model_path, espeak_data_path, jieba_dict_path)) { ALOGE("Init server failed!"); return -1; } server.start(port); return 0; }