1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef ADAPTER_MANAGER_HOST_H 16 #define ADAPTER_MANAGER_HOST_H 17 18 #include "i_adapter_host_manager.h" 19 20 namespace OHOS { 21 namespace IntellVoiceEngine { 22 class AdapterHostManager : public IAdapterHostManager { 23 public: 24 AdapterHostManager() = default; 25 ~AdapterHostManager() override; 26 bool Init(const IntellVoiceEngineAdapterDescriptor &desc) override; 27 int32_t SetCallback(const sptr<IIntellVoiceEngineCallback> &engineCallback) override; 28 int32_t Attach(const OHOS::HDI::IntelligentVoice::Engine::V1_0::IntellVoiceEngineAdapterInfo &info) override; 29 int32_t Detach() override; 30 int32_t SetParameter(const std::string &keyValueList) override; 31 int32_t GetParameter(const std::string &keyList, std::string &valueList) override; 32 int32_t Start(const OHOS::HDI::IntelligentVoice::Engine::V1_0::StartInfo &info) override; 33 int32_t Stop() override; 34 int32_t WriteAudio(const std::vector<uint8_t> &buffer) override; 35 int32_t Read(OHOS::HDI::IntelligentVoice::Engine::V1_0::ContentType type, sptr<Ashmem> &buffer) override; 36 int32_t GetWakeupPcm(std::vector<uint8_t> &data) override; 37 int32_t Evaluate(const std::string &word, EvaluationResultInfo &info) override; 38 39 private: 40 sptr<OHOS::HDI::IntelligentVoice::Engine::V1_0::IIntellVoiceEngineAdapter> adapterProxy1_0_ = nullptr; 41 sptr<OHOS::HDI::IntelligentVoice::Engine::V1_2::IIntellVoiceEngineAdapter> adapterProxy1_2_ = nullptr; 42 }; 43 } 44 } 45 #endif 46