Add keyword spotter C API for HarmonyOS (#1769)

This commit is contained in:
Fangjun Kuang
2025-01-26 14:12:30 +08:00
committed by GitHub
parent 73c3695287
commit f178e96bf0
8 changed files with 135 additions and 42 deletions

View File

@@ -9,11 +9,6 @@
#include <string>
#include <vector>
#if __ANDROID_API__ >= 9
#include "android/asset_manager.h"
#include "android/asset_manager_jni.h"
#endif
#include "sherpa-onnx/csrc/keyword-spotter.h"
#include "sherpa-onnx/csrc/online-stream.h"
@@ -24,10 +19,9 @@ class KeywordSpotterImpl {
static std::unique_ptr<KeywordSpotterImpl> Create(
const KeywordSpotterConfig &config);
#if __ANDROID_API__ >= 9
template <typename Manager>
static std::unique_ptr<KeywordSpotterImpl> Create(
AAssetManager *mgr, const KeywordSpotterConfig &config);
#endif
Manager *mgr, const KeywordSpotterConfig &config);
virtual ~KeywordSpotterImpl() = default;