Add HarmonyOS support for text-to-speech. (#1584)
This commit is contained in:
@@ -6,6 +6,15 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
#include "android/asset_manager.h"
|
||||
#include "android/asset_manager_jni.h"
|
||||
#endif
|
||||
|
||||
#if __OHOS__
|
||||
#include "rawfile/raw_file_manager.h"
|
||||
#endif
|
||||
|
||||
#include "sherpa-onnx/csrc/offline-tts-vits-impl.h"
|
||||
|
||||
namespace sherpa_onnx {
|
||||
@@ -16,12 +25,21 @@ std::unique_ptr<OfflineTtsImpl> OfflineTtsImpl::Create(
|
||||
return std::make_unique<OfflineTtsVitsImpl>(config);
|
||||
}
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
template <typename Manager>
|
||||
std::unique_ptr<OfflineTtsImpl> OfflineTtsImpl::Create(
|
||||
AAssetManager *mgr, const OfflineTtsConfig &config) {
|
||||
Manager *mgr, const OfflineTtsConfig &config) {
|
||||
// TODO(fangjun): Support other types
|
||||
return std::make_unique<OfflineTtsVitsImpl>(mgr, config);
|
||||
}
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
template std::unique_ptr<OfflineTtsImpl> OfflineTtsImpl::Create(
|
||||
AAssetManager *mgr, const OfflineTtsConfig &config);
|
||||
#endif
|
||||
|
||||
#if __OHOS__
|
||||
template std::unique_ptr<OfflineTtsImpl> OfflineTtsImpl::Create(
|
||||
NativeResourceManager *mgr, const OfflineTtsConfig &config);
|
||||
#endif
|
||||
|
||||
} // namespace sherpa_onnx
|
||||
|
||||
Reference in New Issue
Block a user