add streaming websocket server and client (#62)

This commit is contained in:
Fangjun Kuang
2023-02-24 21:39:51 +08:00
committed by GitHub
parent ce4dd176e4
commit 40522f037b
20 changed files with 1197 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
// sherpa-onnx/csrc/file-utils.cc
//
// Copyright (c) 2022-2023 Xiaomi Corporation
#include "sherpa-onnx/csrc/file-utils.h"
#include <fstream>
#include <string>
#include "sherpa-onnx/csrc/log.h"
namespace sherpa_onnx {
bool FileExists(const std::string &filename) {
return std::ifstream(filename).good();
}
void AssertFileExists(const std::string &filename) {
if (!FileExists(filename)) {
SHERPA_ONNX_LOG(FATAL) << filename << " does not exist!";
}
}
} // namespace sherpa_onnx