Yabin Li
2023-08-21 e0fa63765bfb4a36bde7047c2a6066ca5a80e90f
funasr/runtime/websocket/websocket-server.h
@@ -46,13 +46,17 @@
    context_ptr;
typedef struct {
  std::string msg;
  float snippet_time;
    std::string msg="";
    std::string stamp="";
    std::string tpass_msg="";
    float snippet_time=0;
} FUNASR_RECOG_RESULT;
typedef struct {
  nlohmann::json msg;
  std::shared_ptr<std::vector<char>> samples;
  std::shared_ptr<std::vector<std::vector<float>>> hotwords_embedding=NULL;
  std::shared_ptr<websocketpp::lib::mutex> thread_lock; // lock for each connection
} FUNASR_MESSAGE;
// See https://wiki.mozilla.org/Security/Server_Side_TLS for more details about
@@ -106,7 +110,10 @@
    }
  }
  void do_decoder(const std::vector<char>& buffer,
                  websocketpp::connection_hdl& hdl, const nlohmann::json& msg);
                  websocketpp::connection_hdl& hdl,
                  websocketpp::lib::mutex& thread_lock,
                  std::vector<std::vector<float>> &hotwords_embedding,
                  std::string wav_name, std::string wav_format);
  void initAsr(std::map<std::string, std::string>& model_path, int thread_num);
  void on_message(websocketpp::connection_hdl hdl, message_ptr msg);