Add C++ runtime for silero_vad with RKNN (#2078)

This commit is contained in:
Fangjun Kuang
2025-04-01 15:56:56 +08:00
committed by GitHub
parent 0703bc1b86
commit 8e51a97550
12 changed files with 867 additions and 16 deletions

View File

@@ -13,19 +13,27 @@
#include "rawfile/raw_file_manager.h"
#endif
#if SHERPA_ONNX_ENABLE_RKNN
#include "sherpa-onnx/csrc/rknn/silero-vad-model-rknn.h"
#endif
#include "sherpa-onnx/csrc/silero-vad-model.h"
namespace sherpa_onnx {
std::unique_ptr<VadModel> VadModel::Create(const VadModelConfig &config) {
// TODO(fangjun): Support other VAD models.
if (config.provider == "rknn") {
return std::make_unique<SileroVadModelRknn>(config);
}
return std::make_unique<SileroVadModel>(config);
}
template <typename Manager>
std::unique_ptr<VadModel> VadModel::Create(Manager *mgr,
const VadModelConfig &config) {
// TODO(fangjun): Support other VAD models.
if (config.provider == "rknn") {
return std::make_unique<SileroVadModelRknn>(mgr, config);
}
return std::make_unique<SileroVadModel>(mgr, config);
}