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 I_ADAPTER_HOST_MANAGER_H 16 #define I_ADAPTER_HOST_MANAGER_H 17 18 #include "v1_0/iintell_voice_engine_manager.h" 19 #include "v1_2/iintell_voice_engine_manager.h" 20 #include "v1_0/iintell_voice_engine_adapter.h" 21 #include "v1_2/iintell_voice_engine_adapter.h" 22 23 namespace OHOS { 24 namespace IntellVoiceEngine { 25 using OHOS::HDI::IntelligentVoice::Engine::V1_0::IntellVoiceEngineAdapterDescriptor; 26 using OHOS::HDI::IntelligentVoice::Engine::V1_0::IIntellVoiceEngineCallback; 27 using OHOS::HDI::IntelligentVoice::Engine::V1_2::EvaluationResultInfo; 28 29 class IAdapterHostManager { 30 public: 31 IAdapterHostManager() = default; 32 virtual ~IAdapterHostManager() = default; 33 virtual bool Init(const IntellVoiceEngineAdapterDescriptor &desc) = 0; 34 virtual int32_t SetCallback(const sptr<IIntellVoiceEngineCallback> &engineCallback) = 0; 35 virtual int32_t Attach(const OHOS::HDI::IntelligentVoice::Engine::V1_0::IntellVoiceEngineAdapterInfo &info) = 0; 36 virtual int32_t Detach() = 0; 37 virtual int32_t SetParameter(const std::string &keyValueList) = 0; 38 virtual int32_t GetParameter(const std::string &keyList, std::string &valueList) = 0; 39 virtual int32_t Start(const OHOS::HDI::IntelligentVoice::Engine::V1_0::StartInfo &info) = 0; 40 virtual int32_t Stop() = 0; 41 virtual int32_t WriteAudio(const std::vector<uint8_t> &buffer) = 0; 42 virtual int32_t Read(OHOS::HDI::IntelligentVoice::Engine::V1_0::ContentType type, sptr<Ashmem> &buffer) = 0; 43 virtual int32_t GetWakeupPcm(std::vector<uint8_t> &data) = 0; 44 virtual int32_t Evaluate(const std::string &word, EvaluationResultInfo &info) = 0; 45 }; 46 } 47 } 48 #endif