update java for paraformer (#276)

This commit is contained in:
zhaomingwork
2023-08-16 20:16:51 +08:00
committed by GitHub
parent f709c95c5f
commit 256a8ecb50
6 changed files with 109 additions and 46 deletions

View File

@@ -218,14 +218,15 @@ public class AsrWebsocketServer extends WebSocketServer {
String soPath = args[0];
String cfgPath = args[1];
OnlineRecognizer.setSoPath(soPath);
logger.info("readProperties");
Map<String, String> cfgMap = AsrWebsocketServer.readProperties(cfgPath);
int port = Integer.valueOf(cfgMap.get("port"));
int connectionThreadNum = Integer.valueOf(cfgMap.get("connection_thread_num"));
AsrWebsocketServer s = new AsrWebsocketServer(port, connectionThreadNum);
logger.info("initModelWithCfg");
s.initModelWithCfg(cfgMap, cfgPath);
logger.info("Server started on port: " + s.getPort());
s.start();