HarmonyOS support for VAD. (#1561)
This commit is contained in:
@@ -37,8 +37,9 @@ class SileroVadModel::Impl {
|
||||
min_speech_samples_ = sample_rate_ * config_.silero_vad.min_speech_duration;
|
||||
}
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
Impl(AAssetManager *mgr, const VadModelConfig &config)
|
||||
#if __ANDROID_API__ >= 9 || defined(__OHOS__)
|
||||
template <typename Manager>
|
||||
Impl(Manager *mgr, const VadModelConfig &config)
|
||||
: config_(config),
|
||||
env_(ORT_LOGGING_LEVEL_ERROR),
|
||||
sess_opts_(GetSessionOptions(config)),
|
||||
@@ -437,6 +438,12 @@ SileroVadModel::SileroVadModel(AAssetManager *mgr, const VadModelConfig &config)
|
||||
: impl_(std::make_unique<Impl>(mgr, config)) {}
|
||||
#endif
|
||||
|
||||
#if __OHOS__
|
||||
SileroVadModel::SileroVadModel(NativeResourceManager *mgr,
|
||||
const VadModelConfig &config)
|
||||
: impl_(std::make_unique<Impl>(mgr, config)) {}
|
||||
#endif
|
||||
|
||||
SileroVadModel::~SileroVadModel() = default;
|
||||
|
||||
void SileroVadModel::Reset() { return impl_->Reset(); }
|
||||
|
||||
Reference in New Issue
Block a user