1 /* 2 * Copyright (c) 2023 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 16 #ifndef WAKEUP_INTELL_VOICE_ENGINE_H 17 #define WAKEUP_INTELL_VOICE_ENGINE_H 18 19 #include "intell_voice_info.h" 20 #include "i_intell_voice_engine.h" 21 #include "engine_callback_inner.h" 22 23 namespace OHOS { 24 namespace IntellVoice { 25 using OHOS::IntellVoiceEngine::IIntellVoiceEngineEventCallback; 26 using OHOS::IntellVoiceEngine::IIntellVoiceEngine; 27 using OHOS::IntellVoiceEngine::EngineCallbackInner; 28 29 struct WakeupIntelligentVoiceEngineDescriptor { 30 bool needReconfirm; 31 std::string wakeupPhrase; 32 }; 33 34 class WakeupIntellVoiceEngine { 35 public: 36 WakeupIntellVoiceEngine(const WakeupIntelligentVoiceEngineDescriptor &descriptor); 37 ~WakeupIntellVoiceEngine(); 38 39 int32_t SetSensibility(const int32_t &sensibility); 40 int32_t SetWakeupHapInfo(const WakeupHapInfo &info); 41 int32_t SetParameter(const std::string &key, const std::string &value); 42 int32_t GetParameter(const std::string &key); 43 int32_t Release(); 44 int32_t SetCallback(std::shared_ptr<IIntellVoiceEngineEventCallback> callback); 45 46 private: 47 sptr<IIntellVoiceEngine> engine_ = nullptr; 48 std::unique_ptr<WakeupIntelligentVoiceEngineDescriptor> descriptor_ = nullptr; 49 sptr<EngineCallbackInner> callback_ = nullptr; 50 }; 51 } // namespace IntellVoice 52 } // namespace OHOS 53 54 #endif 55