161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit BasicServicesKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * @namespace intelligentVoice 2561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2661847f8eSopenharmony_ci * @systemapi 2761847f8eSopenharmony_ci * @since 10 2861847f8eSopenharmony_ci */ 2961847f8eSopenharmony_cideclare namespace intelligentVoice { 3061847f8eSopenharmony_ci /** 3161847f8eSopenharmony_ci * Obtains an {@link IntelligentVoiceManager} instance. 3261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 3361847f8eSopenharmony_ci * @returns { IntelligentVoiceManager } this {@link IntelligentVoiceManager} object. 3461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 3561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 3661847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 3761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3861847f8eSopenharmony_ci * @systemapi 3961847f8eSopenharmony_ci * @since 10 4061847f8eSopenharmony_ci */ 4161847f8eSopenharmony_ci function getIntelligentVoiceManager(): IntelligentVoiceManager; 4261847f8eSopenharmony_ci 4361847f8eSopenharmony_ci /** 4461847f8eSopenharmony_ci * Implements intelligent voice management. 4561847f8eSopenharmony_ci * @typedef IntelligentVoiceManager 4661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4761847f8eSopenharmony_ci * @systemapi 4861847f8eSopenharmony_ci * @since 10 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci interface IntelligentVoiceManager { 5161847f8eSopenharmony_ci /** 5261847f8eSopenharmony_ci * Obtains capability information. 5361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 5461847f8eSopenharmony_ci * @returns { Array<IntelligentVoiceEngineType> } array of supported IntelligentVoiceEngineType. 5561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 5761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5861847f8eSopenharmony_ci * @systemapi 5961847f8eSopenharmony_ci * @since 10 6061847f8eSopenharmony_ci */ 6161847f8eSopenharmony_ci getCapabilityInfo(): Array<IntelligentVoiceEngineType>; 6261847f8eSopenharmony_ci /** 6361847f8eSopenharmony_ci * Subscribes service change events. When the state of intelligent voice service changes, 6461847f8eSopenharmony_ci * the callback is invoked. 6561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 6661847f8eSopenharmony_ci * @param { 'serviceChange' } type - Type of the event to listen for. Only the serviceChange event is supported. 6761847f8eSopenharmony_ci * @param { Callback<ServiceChangeType> } callback - Callback is invoked when the event is triggered. 6861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 6961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 7061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7161847f8eSopenharmony_ci * @systemapi 7261847f8eSopenharmony_ci * @since 10 7361847f8eSopenharmony_ci */ 7461847f8eSopenharmony_ci on(type: 'serviceChange', callback: Callback<ServiceChangeType>): void; 7561847f8eSopenharmony_ci /** 7661847f8eSopenharmony_ci * Unsubscribes service change events. 7761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 7861847f8eSopenharmony_ci * @param { 'serviceChange' } type - Type of the event to listen for. Only the serviceChange event is supported. 7961847f8eSopenharmony_ci * @param { Callback<ServiceChangeType> } [callback] - Callback is invoked when the event is triggered. 8061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 8161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 8261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8361847f8eSopenharmony_ci * @systemapi 8461847f8eSopenharmony_ci * @since 10 8561847f8eSopenharmony_ci */ 8661847f8eSopenharmony_ci off(type: 'serviceChange', callback?: Callback<ServiceChangeType>): void; 8761847f8eSopenharmony_ci } 8861847f8eSopenharmony_ci 8961847f8eSopenharmony_ci /** 9061847f8eSopenharmony_ci * Implements wakeup management. 9161847f8eSopenharmony_ci * @typedef WakeupManager 9261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9361847f8eSopenharmony_ci * @systemapi 9461847f8eSopenharmony_ci * @since 12 9561847f8eSopenharmony_ci */ 9661847f8eSopenharmony_ci interface WakeupManager { 9761847f8eSopenharmony_ci /** 9861847f8eSopenharmony_ci * Sets an intelligent voice parameter. This method uses a promise to return the result. 9961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10061847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 10161847f8eSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 10261847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 10361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 10661847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 10761847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 10861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10961847f8eSopenharmony_ci * @systemapi 11061847f8eSopenharmony_ci * @since 12 11161847f8eSopenharmony_ci */ 11261847f8eSopenharmony_ci setParameter(key: string, value: string): Promise<void>; 11361847f8eSopenharmony_ci /** 11461847f8eSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result. 11561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11661847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 11761847f8eSopenharmony_ci * @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter. 11861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 12161847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 12261847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 12361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12461847f8eSopenharmony_ci * @systemapi 12561847f8eSopenharmony_ci * @since 12 12661847f8eSopenharmony_ci */ 12761847f8eSopenharmony_ci getParameter(key: string): Promise<string>; 12861847f8eSopenharmony_ci /** 12961847f8eSopenharmony_ci * Obtains files needed to upload. This method uses a promise to return the files needed to upload. 13061847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13161847f8eSopenharmony_ci * @param { number } maxCount - the maximum count of upload files. The maxCount should be greater than 0 and smaller than 101 13261847f8eSopenharmony_ci * @returns { Promise<Array<UploadFile>> } the promise used to return the upload files. 13361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3.Parameter verification failed. 13661847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 13761847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 13861847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 13961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 14061847f8eSopenharmony_ci * @systemapi 14161847f8eSopenharmony_ci * @since 12 14261847f8eSopenharmony_ci */ 14361847f8eSopenharmony_ci getUploadFiles (maxCount: number): Promise<Array<UploadFile>>; 14461847f8eSopenharmony_ci /** 14561847f8eSopenharmony_ci * Obtains wakeup source files. This method uses a promise to return the wakeup source files. 14661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 14761847f8eSopenharmony_ci * @returns { Promise<Array<WakeupSourceFile>> } the promise used to return the wakeup source files. 14861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 14961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 15061847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 15161847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 15261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 15361847f8eSopenharmony_ci * @systemapi 15461847f8eSopenharmony_ci * @since 12 15561847f8eSopenharmony_ci */ 15661847f8eSopenharmony_ci getWakeupSourceFiles(): Promise<Array<WakeupSourceFile>>; 15761847f8eSopenharmony_ci /** 15861847f8eSopenharmony_ci * Enrolls with wakeup files for result. This method uses a promise to return the enroll result. 15961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 16061847f8eSopenharmony_ci * @param { Array<WakeupSourceFile> } wakeupFiles - the wakeup source files needed. 16161847f8eSopenharmony_ci * @param { string } wakeupInfo - wakeup information. 16261847f8eSopenharmony_ci * @returns { Promise<EnrollResult> } the promise used to return the enroll result. 16361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 16461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 16561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 16661847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 16761847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 16861847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 16961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 17061847f8eSopenharmony_ci * @systemapi 17161847f8eSopenharmony_ci * @since 12 17261847f8eSopenharmony_ci */ 17361847f8eSopenharmony_ci enrollWithWakeupFilesForResult(wakeupFiles: Array<WakeupSourceFile>, wakeupInfo: string): Promise<EnrollResult>; 17461847f8eSopenharmony_ci /** 17561847f8eSopenharmony_ci * Clears user data. 17661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 17761847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 17861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 17961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 18061847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 18161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 18261847f8eSopenharmony_ci * @systemapi 18361847f8eSopenharmony_ci * @since 12 18461847f8eSopenharmony_ci */ 18561847f8eSopenharmony_ci clearUserData(): Promise<void>; 18661847f8eSopenharmony_ci } 18761847f8eSopenharmony_ci 18861847f8eSopenharmony_ci /** 18961847f8eSopenharmony_ci * Enumerates upload file type. 19061847f8eSopenharmony_ci * @enum {number} 19161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 19261847f8eSopenharmony_ci * @systemapi 19361847f8eSopenharmony_ci * @since 12 19461847f8eSopenharmony_ci */ 19561847f8eSopenharmony_ci enum UploadFileType { 19661847f8eSopenharmony_ci /** 19761847f8eSopenharmony_ci * Enroll file. 19861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 19961847f8eSopenharmony_ci * @systemapi 20061847f8eSopenharmony_ci * @since 12 20161847f8eSopenharmony_ci */ 20261847f8eSopenharmony_ci ENROLL_FILE = 0, 20361847f8eSopenharmony_ci /** 20461847f8eSopenharmony_ci * Wakeup file. 20561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 20661847f8eSopenharmony_ci * @systemapi 20761847f8eSopenharmony_ci * @since 12 20861847f8eSopenharmony_ci */ 20961847f8eSopenharmony_ci WAKEUP_FILE = 1, 21061847f8eSopenharmony_ci } 21161847f8eSopenharmony_ci 21261847f8eSopenharmony_ci /** 21361847f8eSopenharmony_ci * Describes upload file information. 21461847f8eSopenharmony_ci * @typedef UploadFile 21561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 21661847f8eSopenharmony_ci * @systemapi 21761847f8eSopenharmony_ci * @since 12 21861847f8eSopenharmony_ci */ 21961847f8eSopenharmony_ci interface UploadFile { 22061847f8eSopenharmony_ci /** 22161847f8eSopenharmony_ci * Report file type. 22261847f8eSopenharmony_ci * @type { UploadFileType } 22361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 22461847f8eSopenharmony_ci * @systemapi 22561847f8eSopenharmony_ci * @since 12 22661847f8eSopenharmony_ci */ 22761847f8eSopenharmony_ci type: UploadFileType; 22861847f8eSopenharmony_ci /** 22961847f8eSopenharmony_ci * Files description. 23061847f8eSopenharmony_ci * @type { string } 23161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 23261847f8eSopenharmony_ci * @systemapi 23361847f8eSopenharmony_ci * @since 12 23461847f8eSopenharmony_ci */ 23561847f8eSopenharmony_ci filesDescription: string; 23661847f8eSopenharmony_ci /** 23761847f8eSopenharmony_ci * Files content. 23861847f8eSopenharmony_ci * @type { Array<ArrayBuffer> } 23961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 24061847f8eSopenharmony_ci * @systemapi 24161847f8eSopenharmony_ci * @since 12 24261847f8eSopenharmony_ci */ 24361847f8eSopenharmony_ci filesContent: Array<ArrayBuffer>; 24461847f8eSopenharmony_ci } 24561847f8eSopenharmony_ci 24661847f8eSopenharmony_ci /** 24761847f8eSopenharmony_ci * Describes wakeup source file information. 24861847f8eSopenharmony_ci * @typedef WakeupSourceFile 24961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 25061847f8eSopenharmony_ci * @systemapi 25161847f8eSopenharmony_ci * @since 12 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ci interface WakeupSourceFile { 25461847f8eSopenharmony_ci /** 25561847f8eSopenharmony_ci * File path. 25661847f8eSopenharmony_ci * @type { string } 25761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 25861847f8eSopenharmony_ci * @systemapi 25961847f8eSopenharmony_ci * @since 12 26061847f8eSopenharmony_ci */ 26161847f8eSopenharmony_ci filePath: string; 26261847f8eSopenharmony_ci /** 26361847f8eSopenharmony_ci * File content. 26461847f8eSopenharmony_ci * @type { ArrayBuffer } 26561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 26661847f8eSopenharmony_ci * @systemapi 26761847f8eSopenharmony_ci * @since 12 26861847f8eSopenharmony_ci */ 26961847f8eSopenharmony_ci fileContent: ArrayBuffer; 27061847f8eSopenharmony_ci } 27161847f8eSopenharmony_ci 27261847f8eSopenharmony_ci /** 27361847f8eSopenharmony_ci * Enumerates service change type. 27461847f8eSopenharmony_ci * @enum {number} 27561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 27661847f8eSopenharmony_ci * @systemapi 27761847f8eSopenharmony_ci * @since 10 27861847f8eSopenharmony_ci */ 27961847f8eSopenharmony_ci enum ServiceChangeType { 28061847f8eSopenharmony_ci /** 28161847f8eSopenharmony_ci * Service unavailable. 28261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 28361847f8eSopenharmony_ci * @systemapi 28461847f8eSopenharmony_ci * @since 10 28561847f8eSopenharmony_ci */ 28661847f8eSopenharmony_ci SERVICE_UNAVAILABLE = 0, 28761847f8eSopenharmony_ci } 28861847f8eSopenharmony_ci 28961847f8eSopenharmony_ci /** 29061847f8eSopenharmony_ci * Enumerates intelligent voice engine type. 29161847f8eSopenharmony_ci * @enum {number} 29261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 29361847f8eSopenharmony_ci * @systemapi 29461847f8eSopenharmony_ci * @since 10 29561847f8eSopenharmony_ci */ 29661847f8eSopenharmony_ci enum IntelligentVoiceEngineType { 29761847f8eSopenharmony_ci /** 29861847f8eSopenharmony_ci * Enroll engine. 29961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 30061847f8eSopenharmony_ci * @systemapi 30161847f8eSopenharmony_ci * @since 10 30261847f8eSopenharmony_ci */ 30361847f8eSopenharmony_ci ENROLL_ENGINE_TYPE = 0, 30461847f8eSopenharmony_ci /** 30561847f8eSopenharmony_ci * Wakeup engine. 30661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 30761847f8eSopenharmony_ci * @systemapi 30861847f8eSopenharmony_ci * @since 10 30961847f8eSopenharmony_ci */ 31061847f8eSopenharmony_ci WAKEUP_ENGINE_TYPE = 1, 31161847f8eSopenharmony_ci /** 31261847f8eSopenharmony_ci * Update engine. 31361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 31461847f8eSopenharmony_ci * @systemapi 31561847f8eSopenharmony_ci * @since 10 31661847f8eSopenharmony_ci */ 31761847f8eSopenharmony_ci UPDATE_ENGINE_TYPE = 2, 31861847f8eSopenharmony_ci } 31961847f8eSopenharmony_ci 32061847f8eSopenharmony_ci /** 32161847f8eSopenharmony_ci * Describes enroll intelligent voice engine. 32261847f8eSopenharmony_ci * @typedef EnrollIntelligentVoiceEngineDescriptor 32361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 32461847f8eSopenharmony_ci * @systemapi 32561847f8eSopenharmony_ci * @since 10 32661847f8eSopenharmony_ci */ 32761847f8eSopenharmony_ci interface EnrollIntelligentVoiceEngineDescriptor { 32861847f8eSopenharmony_ci /** 32961847f8eSopenharmony_ci * Wakeup phrase. 33061847f8eSopenharmony_ci * @type { string } 33161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 33261847f8eSopenharmony_ci * @systemapi 33361847f8eSopenharmony_ci * @since 10 33461847f8eSopenharmony_ci */ 33561847f8eSopenharmony_ci wakeupPhrase: string; 33661847f8eSopenharmony_ci } 33761847f8eSopenharmony_ci 33861847f8eSopenharmony_ci /** 33961847f8eSopenharmony_ci * Describes wakeup intelligent voice engine. 34061847f8eSopenharmony_ci * @typedef WakeupIntelligentVoiceEngineDescriptor 34161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 34261847f8eSopenharmony_ci * @systemapi 34361847f8eSopenharmony_ci * @since 10 34461847f8eSopenharmony_ci */ 34561847f8eSopenharmony_ci interface WakeupIntelligentVoiceEngineDescriptor { 34661847f8eSopenharmony_ci /** 34761847f8eSopenharmony_ci * Need reconfirm. 34861847f8eSopenharmony_ci * @type { boolean } 34961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 35061847f8eSopenharmony_ci * @systemapi 35161847f8eSopenharmony_ci * @since 10 35261847f8eSopenharmony_ci */ 35361847f8eSopenharmony_ci needReconfirm: boolean; 35461847f8eSopenharmony_ci /** 35561847f8eSopenharmony_ci * Wakeup phrase. 35661847f8eSopenharmony_ci * @type { string } 35761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 35861847f8eSopenharmony_ci * @systemapi 35961847f8eSopenharmony_ci * @since 10 36061847f8eSopenharmony_ci */ 36161847f8eSopenharmony_ci wakeupPhrase: string; 36261847f8eSopenharmony_ci } 36361847f8eSopenharmony_ci 36461847f8eSopenharmony_ci /** 36561847f8eSopenharmony_ci * Enumerates evaluation result code. 36661847f8eSopenharmony_ci * @enum {number} 36761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 36861847f8eSopenharmony_ci * @systemapi 36961847f8eSopenharmony_ci * @since 12 37061847f8eSopenharmony_ci */ 37161847f8eSopenharmony_ci enum EvaluationResultCode { 37261847f8eSopenharmony_ci /** 37361847f8eSopenharmony_ci * Unknown. 37461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 37561847f8eSopenharmony_ci * @systemapi 37661847f8eSopenharmony_ci * @since 12 37761847f8eSopenharmony_ci */ 37861847f8eSopenharmony_ci UNKNOWN = 0, 37961847f8eSopenharmony_ci /** 38061847f8eSopenharmony_ci * Pass. 38161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 38261847f8eSopenharmony_ci * @systemapi 38361847f8eSopenharmony_ci * @since 12 38461847f8eSopenharmony_ci */ 38561847f8eSopenharmony_ci PASS = 1, 38661847f8eSopenharmony_ci /** 38761847f8eSopenharmony_ci * Word is empty. 38861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 38961847f8eSopenharmony_ci * @systemapi 39061847f8eSopenharmony_ci * @since 12 39161847f8eSopenharmony_ci */ 39261847f8eSopenharmony_ci WORD_EMPTY = 2, 39361847f8eSopenharmony_ci /** 39461847f8eSopenharmony_ci * Only chinese is supported. 39561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 39661847f8eSopenharmony_ci * @systemapi 39761847f8eSopenharmony_ci * @since 12 39861847f8eSopenharmony_ci */ 39961847f8eSopenharmony_ci CHINESE_ONLY = 3, 40061847f8eSopenharmony_ci /** 40161847f8eSopenharmony_ci * Invalid length. 40261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 40361847f8eSopenharmony_ci * @systemapi 40461847f8eSopenharmony_ci * @since 12 40561847f8eSopenharmony_ci */ 40661847f8eSopenharmony_ci INVALID_LENGTH = 4, 40761847f8eSopenharmony_ci /** 40861847f8eSopenharmony_ci * Unusual word. 40961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 41061847f8eSopenharmony_ci * @systemapi 41161847f8eSopenharmony_ci * @since 12 41261847f8eSopenharmony_ci */ 41361847f8eSopenharmony_ci UNUSUAL_WORD = 5, 41461847f8eSopenharmony_ci /** 41561847f8eSopenharmony_ci * Consecutive same word. 41661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 41761847f8eSopenharmony_ci * @systemapi 41861847f8eSopenharmony_ci * @since 12 41961847f8eSopenharmony_ci */ 42061847f8eSopenharmony_ci CONSECUTIVE_SAME_WORD = 6, 42161847f8eSopenharmony_ci /** 42261847f8eSopenharmony_ci * Too few phonemes. 42361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 42461847f8eSopenharmony_ci * @systemapi 42561847f8eSopenharmony_ci * @since 12 42661847f8eSopenharmony_ci */ 42761847f8eSopenharmony_ci TOO_FEW_PHONEMES = 7, 42861847f8eSopenharmony_ci /** 42961847f8eSopenharmony_ci * Too many phonemes. 43061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 43161847f8eSopenharmony_ci * @systemapi 43261847f8eSopenharmony_ci * @since 12 43361847f8eSopenharmony_ci */ 43461847f8eSopenharmony_ci TOO_MANY_PHONEMES = 8, 43561847f8eSopenharmony_ci /** 43661847f8eSopenharmony_ci * Contain common instruction. 43761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 43861847f8eSopenharmony_ci * @systemapi 43961847f8eSopenharmony_ci * @since 12 44061847f8eSopenharmony_ci */ 44161847f8eSopenharmony_ci COMMON_INSTRUCTION = 9, 44261847f8eSopenharmony_ci /** 44361847f8eSopenharmony_ci * Contain common spoken language. 44461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 44561847f8eSopenharmony_ci * @systemapi 44661847f8eSopenharmony_ci * @since 12 44761847f8eSopenharmony_ci */ 44861847f8eSopenharmony_ci COMMON_SPOKEN_LANGUAGE = 10, 44961847f8eSopenharmony_ci /** 45061847f8eSopenharmony_ci * Contain sensitive word. 45161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 45261847f8eSopenharmony_ci * @systemapi 45361847f8eSopenharmony_ci * @since 12 45461847f8eSopenharmony_ci */ 45561847f8eSopenharmony_ci SENSITIVE_WORD = 11, 45661847f8eSopenharmony_ci /** 45761847f8eSopenharmony_ci * Two consecutive words without initial consonant. 45861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 45961847f8eSopenharmony_ci * @systemapi 46061847f8eSopenharmony_ci * @since 12 46161847f8eSopenharmony_ci */ 46261847f8eSopenharmony_ci NO_INITIAL_CONSONANT = 12, 46361847f8eSopenharmony_ci /** 46461847f8eSopenharmony_ci * Contain repeated phoneme. 46561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 46661847f8eSopenharmony_ci * @systemapi 46761847f8eSopenharmony_ci * @since 12 46861847f8eSopenharmony_ci */ 46961847f8eSopenharmony_ci REPEATED_PHONEME = 13, 47061847f8eSopenharmony_ci } 47161847f8eSopenharmony_ci 47261847f8eSopenharmony_ci /** 47361847f8eSopenharmony_ci * Describes evaluation result. 47461847f8eSopenharmony_ci * @typedef EvaluationResult 47561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 47661847f8eSopenharmony_ci * @systemapi 47761847f8eSopenharmony_ci * @since 12 47861847f8eSopenharmony_ci */ 47961847f8eSopenharmony_ci interface EvaluationResult { 48061847f8eSopenharmony_ci /** 48161847f8eSopenharmony_ci * Evaluation score. 48261847f8eSopenharmony_ci * @type { number } 48361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 48461847f8eSopenharmony_ci * @systemapi 48561847f8eSopenharmony_ci * @since 12 48661847f8eSopenharmony_ci */ 48761847f8eSopenharmony_ci score: number; 48861847f8eSopenharmony_ci /** 48961847f8eSopenharmony_ci * Describes evaluation result code. 49061847f8eSopenharmony_ci * @type { EvaluationResultCode } 49161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 49261847f8eSopenharmony_ci * @systemapi 49361847f8eSopenharmony_ci * @since 12 49461847f8eSopenharmony_ci */ 49561847f8eSopenharmony_ci resultCode: EvaluationResultCode; 49661847f8eSopenharmony_ci } 49761847f8eSopenharmony_ci 49861847f8eSopenharmony_ci /** 49961847f8eSopenharmony_ci * Obtains an {@link WakeupManager} instance. 50061847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 50161847f8eSopenharmony_ci * @returns { WakeupManager } this {@link WakeupManager} object. 50261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 50361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 50461847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 50561847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 50661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 50761847f8eSopenharmony_ci * @systemapi 50861847f8eSopenharmony_ci * @since 12 50961847f8eSopenharmony_ci */ 51061847f8eSopenharmony_ci function getWakeupManager(): WakeupManager; 51161847f8eSopenharmony_ci 51261847f8eSopenharmony_ci /** 51361847f8eSopenharmony_ci * Obtains an {@link EnrollIntelligentVoiceEngine} instance. This method uses an asynchronous callback to return the EnrollIntelligentVoiceEngine instance. 51461847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 51561847f8eSopenharmony_ci * @param { EnrollIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates enroll intelligent voice engine descriptor. 51661847f8eSopenharmony_ci * @param { AsyncCallback<EnrollIntelligentVoiceEngine> } callback - the callback used to return the EnrollIntelligentVoiceEngine instance. 51761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 51861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 51961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 52061847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 52161847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 52261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 52361847f8eSopenharmony_ci * @systemapi 52461847f8eSopenharmony_ci * @since 10 52561847f8eSopenharmony_ci */ 52661847f8eSopenharmony_ci function createEnrollIntelligentVoiceEngine(descriptor: EnrollIntelligentVoiceEngineDescriptor, callback: AsyncCallback<EnrollIntelligentVoiceEngine>): void; 52761847f8eSopenharmony_ci 52861847f8eSopenharmony_ci /** 52961847f8eSopenharmony_ci * Obtains an {@link EnrollIntelligentVoiceEngine} instance. This method uses a promise to return the EnrollIntelligentVoiceEngine instance. 53061847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 53161847f8eSopenharmony_ci * @param { EnrollIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates enroll intelligent voice engine descriptor. 53261847f8eSopenharmony_ci * @returns { Promise<EnrollIntelligentVoiceEngine> } the promise used to return the EnrollIntelligentVoiceEngine instance. 53361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 53461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 53561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 53661847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 53761847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 53861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 53961847f8eSopenharmony_ci * @systemapi 54061847f8eSopenharmony_ci * @since 10 54161847f8eSopenharmony_ci */ 54261847f8eSopenharmony_ci function createEnrollIntelligentVoiceEngine(descriptor: EnrollIntelligentVoiceEngineDescriptor): Promise<EnrollIntelligentVoiceEngine>; 54361847f8eSopenharmony_ci 54461847f8eSopenharmony_ci /** 54561847f8eSopenharmony_ci * Obtains an {@link WakeupIntelligentVoiceEngine} instance. This method uses an asynchronous callback to return the WakeupIntelligentVoiceEngine instance. 54661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 54761847f8eSopenharmony_ci * @param { WakeupIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates wakeup intelligent voice engine descriptor. 54861847f8eSopenharmony_ci * @param { AsyncCallback<WakeupIntelligentVoiceEngine> } callback - the callback used to return the WakeupIntelligentVoiceEngine instance. 54961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 55061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 55161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 55261847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 55361847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 55461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 55561847f8eSopenharmony_ci * @systemapi 55661847f8eSopenharmony_ci * @since 10 55761847f8eSopenharmony_ci */ 55861847f8eSopenharmony_ci function createWakeupIntelligentVoiceEngine(descriptor: WakeupIntelligentVoiceEngineDescriptor, callback: AsyncCallback<WakeupIntelligentVoiceEngine>): void; 55961847f8eSopenharmony_ci 56061847f8eSopenharmony_ci /** 56161847f8eSopenharmony_ci * Obtains an {@link WakeupIntelligentVoiceEngine} instance. This method uses a promise to return the WakeupIntelligentVoiceEngine instance. 56261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 56361847f8eSopenharmony_ci * @param { WakeupIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates wakeup intelligent voice engine descriptor. 56461847f8eSopenharmony_ci * @returns { Promise<WakeupIntelligentVoiceEngine> } the promise used to return the WakeupIntelligentVoiceEngine instance. 56561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 56661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 56761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 56861847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 56961847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 57061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 57161847f8eSopenharmony_ci * @systemapi 57261847f8eSopenharmony_ci * @since 10 57361847f8eSopenharmony_ci */ 57461847f8eSopenharmony_ci function createWakeupIntelligentVoiceEngine(descriptor: WakeupIntelligentVoiceEngineDescriptor): Promise<WakeupIntelligentVoiceEngine>; 57561847f8eSopenharmony_ci 57661847f8eSopenharmony_ci /** 57761847f8eSopenharmony_ci * Describes enroll engine config. 57861847f8eSopenharmony_ci * @typedef EnrollEngineConfig 57961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 58061847f8eSopenharmony_ci * @systemapi 58161847f8eSopenharmony_ci * @since 10 58261847f8eSopenharmony_ci */ 58361847f8eSopenharmony_ci interface EnrollEngineConfig { 58461847f8eSopenharmony_ci /** 58561847f8eSopenharmony_ci * Language that enroll engine supports. 58661847f8eSopenharmony_ci * @type { string } 58761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 58861847f8eSopenharmony_ci * @systemapi 58961847f8eSopenharmony_ci * @since 10 59061847f8eSopenharmony_ci */ 59161847f8eSopenharmony_ci language: string; 59261847f8eSopenharmony_ci /** 59361847f8eSopenharmony_ci * Region that enroll engine supports. 59461847f8eSopenharmony_ci * @type { string } 59561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 59661847f8eSopenharmony_ci * @systemapi 59761847f8eSopenharmony_ci * @since 10 59861847f8eSopenharmony_ci */ 59961847f8eSopenharmony_ci region: string; 60061847f8eSopenharmony_ci } 60161847f8eSopenharmony_ci 60261847f8eSopenharmony_ci /** 60361847f8eSopenharmony_ci * Enumerates sensibility type. 60461847f8eSopenharmony_ci * @enum {number} 60561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 60661847f8eSopenharmony_ci * @systemapi 60761847f8eSopenharmony_ci * @since 10 60861847f8eSopenharmony_ci */ 60961847f8eSopenharmony_ci enum SensibilityType { 61061847f8eSopenharmony_ci /** 61161847f8eSopenharmony_ci * Low sensibility. 61261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 61361847f8eSopenharmony_ci * @systemapi 61461847f8eSopenharmony_ci * @since 10 61561847f8eSopenharmony_ci */ 61661847f8eSopenharmony_ci LOW_SENSIBILITY = 1, 61761847f8eSopenharmony_ci /** 61861847f8eSopenharmony_ci * Middle sensibility. 61961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 62061847f8eSopenharmony_ci * @systemapi 62161847f8eSopenharmony_ci * @since 10 62261847f8eSopenharmony_ci */ 62361847f8eSopenharmony_ci MIDDLE_SENSIBILITY = 2, 62461847f8eSopenharmony_ci /** 62561847f8eSopenharmony_ci * High sensibility. 62661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 62761847f8eSopenharmony_ci * @systemapi 62861847f8eSopenharmony_ci * @since 10 62961847f8eSopenharmony_ci */ 63061847f8eSopenharmony_ci HIGH_SENSIBILITY = 3, 63161847f8eSopenharmony_ci } 63261847f8eSopenharmony_ci 63361847f8eSopenharmony_ci /** 63461847f8eSopenharmony_ci * Describes wakeup hap information. 63561847f8eSopenharmony_ci * @typedef WakeupHapInfo 63661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 63761847f8eSopenharmony_ci * @systemapi 63861847f8eSopenharmony_ci * @since 10 63961847f8eSopenharmony_ci */ 64061847f8eSopenharmony_ci interface WakeupHapInfo { 64161847f8eSopenharmony_ci /** 64261847f8eSopenharmony_ci * Bundle name. 64361847f8eSopenharmony_ci * @type { string } 64461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 64561847f8eSopenharmony_ci * @systemapi 64661847f8eSopenharmony_ci * @since 10 64761847f8eSopenharmony_ci */ 64861847f8eSopenharmony_ci bundleName: string; 64961847f8eSopenharmony_ci /** 65061847f8eSopenharmony_ci * Ability name. 65161847f8eSopenharmony_ci * @type { string } 65261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 65361847f8eSopenharmony_ci * @systemapi 65461847f8eSopenharmony_ci * @since 10 65561847f8eSopenharmony_ci */ 65661847f8eSopenharmony_ci abilityName: string; 65761847f8eSopenharmony_ci } 65861847f8eSopenharmony_ci 65961847f8eSopenharmony_ci /** 66061847f8eSopenharmony_ci * Enumerates wakeup intelligent voice event type. 66161847f8eSopenharmony_ci * @enum {number} 66261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 66361847f8eSopenharmony_ci * @systemapi 66461847f8eSopenharmony_ci * @since 10 66561847f8eSopenharmony_ci */ 66661847f8eSopenharmony_ci enum WakeupIntelligentVoiceEventType { 66761847f8eSopenharmony_ci /** 66861847f8eSopenharmony_ci * Wakeup None. 66961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 67061847f8eSopenharmony_ci * @systemapi 67161847f8eSopenharmony_ci * @since 10 67261847f8eSopenharmony_ci */ 67361847f8eSopenharmony_ci INTELLIGENT_VOICE_EVENT_WAKEUP_NONE = 0, 67461847f8eSopenharmony_ci /** 67561847f8eSopenharmony_ci * Recognize complete. 67661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 67761847f8eSopenharmony_ci * @systemapi 67861847f8eSopenharmony_ci * @since 10 67961847f8eSopenharmony_ci */ 68061847f8eSopenharmony_ci INTELLIGENT_VOICE_EVENT_RECOGNIZE_COMPLETE = 1, 68161847f8eSopenharmony_ci /** 68261847f8eSopenharmony_ci * Headset Recognize complete. 68361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 68461847f8eSopenharmony_ci * @systemapi 68561847f8eSopenharmony_ci * @since 12 68661847f8eSopenharmony_ci */ 68761847f8eSopenharmony_ci INTELLIGENT_VOICE_EVENT_HEADSET_RECOGNIZE_COMPLETE = 2, 68861847f8eSopenharmony_ci } 68961847f8eSopenharmony_ci 69061847f8eSopenharmony_ci /** 69161847f8eSopenharmony_ci * Enumerates intelligent voice error code. 69261847f8eSopenharmony_ci * @enum {number} 69361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 69461847f8eSopenharmony_ci * @systemapi 69561847f8eSopenharmony_ci * @since 10 69661847f8eSopenharmony_ci */ 69761847f8eSopenharmony_ci enum IntelligentVoiceErrorCode { 69861847f8eSopenharmony_ci /** 69961847f8eSopenharmony_ci * No memory. 70061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 70161847f8eSopenharmony_ci * @systemapi 70261847f8eSopenharmony_ci * @since 10 70361847f8eSopenharmony_ci */ 70461847f8eSopenharmony_ci INTELLIGENT_VOICE_NO_MEMORY = 22700101, 70561847f8eSopenharmony_ci /** 70661847f8eSopenharmony_ci * Invalid parameter. 70761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 70861847f8eSopenharmony_ci * @systemapi 70961847f8eSopenharmony_ci * @since 10 71061847f8eSopenharmony_ci */ 71161847f8eSopenharmony_ci INTELLIGENT_VOICE_INVALID_PARAM = 22700102, 71261847f8eSopenharmony_ci /** 71361847f8eSopenharmony_ci * Init failed. 71461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 71561847f8eSopenharmony_ci * @systemapi 71661847f8eSopenharmony_ci * @since 10 71761847f8eSopenharmony_ci */ 71861847f8eSopenharmony_ci INTELLIGENT_VOICE_INIT_FAILED = 22700103, 71961847f8eSopenharmony_ci /** 72061847f8eSopenharmony_ci * Failed to commit the enrollment. 72161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 72261847f8eSopenharmony_ci * @systemapi 72361847f8eSopenharmony_ci * @since 10 72461847f8eSopenharmony_ci */ 72561847f8eSopenharmony_ci INTELLIGENT_VOICE_COMMIT_ENROLL_FAILED = 22700104, 72661847f8eSopenharmony_ci /** 72761847f8eSopenharmony_ci * Start capturer failed. 72861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 72961847f8eSopenharmony_ci * @systemapi 73061847f8eSopenharmony_ci * @since 12 73161847f8eSopenharmony_ci */ 73261847f8eSopenharmony_ci INTELLIGENT_VOICE_START_CAPTURER_FAILED = 22700105, 73361847f8eSopenharmony_ci /** 73461847f8eSopenharmony_ci * Read failed. 73561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 73661847f8eSopenharmony_ci * @systemapi 73761847f8eSopenharmony_ci * @since 12 73861847f8eSopenharmony_ci */ 73961847f8eSopenharmony_ci INTELLIGENT_VOICE_READ_FAILED = 22700106, 74061847f8eSopenharmony_ci /** 74161847f8eSopenharmony_ci * System error. 74261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 74361847f8eSopenharmony_ci * @systemapi 74461847f8eSopenharmony_ci * @since 12 74561847f8eSopenharmony_ci */ 74661847f8eSopenharmony_ci INTELLIGENT_VOICE_SYSTEM_ERROR = 22700107, 74761847f8eSopenharmony_ci } 74861847f8eSopenharmony_ci 74961847f8eSopenharmony_ci /** 75061847f8eSopenharmony_ci * Enumerates enroll result. 75161847f8eSopenharmony_ci * @enum {number} 75261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 75361847f8eSopenharmony_ci * @systemapi 75461847f8eSopenharmony_ci * @since 10 75561847f8eSopenharmony_ci */ 75661847f8eSopenharmony_ci enum EnrollResult { 75761847f8eSopenharmony_ci /** 75861847f8eSopenharmony_ci * Success. 75961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 76061847f8eSopenharmony_ci * @systemapi 76161847f8eSopenharmony_ci * @since 10 76261847f8eSopenharmony_ci */ 76361847f8eSopenharmony_ci SUCCESS = 0, 76461847f8eSopenharmony_ci /** 76561847f8eSopenharmony_ci * Vpr train failed. 76661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 76761847f8eSopenharmony_ci * @systemapi 76861847f8eSopenharmony_ci * @since 10 76961847f8eSopenharmony_ci */ 77061847f8eSopenharmony_ci VPR_TRAIN_FAILED = -1, 77161847f8eSopenharmony_ci /** 77261847f8eSopenharmony_ci * Wakeup phrase not match. 77361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 77461847f8eSopenharmony_ci * @systemapi 77561847f8eSopenharmony_ci * @since 10 77661847f8eSopenharmony_ci */ 77761847f8eSopenharmony_ci WAKEUP_PHRASE_NOT_MATCH = -2, 77861847f8eSopenharmony_ci /** 77961847f8eSopenharmony_ci * Too noisy. 78061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 78161847f8eSopenharmony_ci * @systemapi 78261847f8eSopenharmony_ci * @since 10 78361847f8eSopenharmony_ci */ 78461847f8eSopenharmony_ci TOO_NOISY = -3, 78561847f8eSopenharmony_ci /** 78661847f8eSopenharmony_ci * Too loud. 78761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 78861847f8eSopenharmony_ci * @systemapi 78961847f8eSopenharmony_ci * @since 10 79061847f8eSopenharmony_ci */ 79161847f8eSopenharmony_ci TOO_LOUD = -4, 79261847f8eSopenharmony_ci /** 79361847f8eSopenharmony_ci * Interval large. 79461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 79561847f8eSopenharmony_ci * @systemapi 79661847f8eSopenharmony_ci * @since 10 79761847f8eSopenharmony_ci */ 79861847f8eSopenharmony_ci INTERVAL_LARGE = -5, 79961847f8eSopenharmony_ci /** 80061847f8eSopenharmony_ci * Different person. 80161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 80261847f8eSopenharmony_ci * @systemapi 80361847f8eSopenharmony_ci * @since 10 80461847f8eSopenharmony_ci */ 80561847f8eSopenharmony_ci DIFFERENT_PERSON = -6, 80661847f8eSopenharmony_ci /** 80761847f8eSopenharmony_ci * Unknown error. 80861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 80961847f8eSopenharmony_ci * @systemapi 81061847f8eSopenharmony_ci * @since 10 81161847f8eSopenharmony_ci */ 81261847f8eSopenharmony_ci UNKNOWN_ERROR = -100, 81361847f8eSopenharmony_ci } 81461847f8eSopenharmony_ci 81561847f8eSopenharmony_ci /** 81661847f8eSopenharmony_ci * Enumerates capturer channel. 81761847f8eSopenharmony_ci * @enum {number} 81861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 81961847f8eSopenharmony_ci * @systemapi 82061847f8eSopenharmony_ci * @since 12 82161847f8eSopenharmony_ci */ 82261847f8eSopenharmony_ci enum CapturerChannel { 82361847f8eSopenharmony_ci /** 82461847f8eSopenharmony_ci * Capturer channel 1. 82561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 82661847f8eSopenharmony_ci * @systemapi 82761847f8eSopenharmony_ci * @since 12 82861847f8eSopenharmony_ci */ 82961847f8eSopenharmony_ci CAPTURER_CHANNEL_1 = 0x1 << 0, 83061847f8eSopenharmony_ci /** 83161847f8eSopenharmony_ci * Capturer channel 2. 83261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 83361847f8eSopenharmony_ci * @systemapi 83461847f8eSopenharmony_ci * @since 12 83561847f8eSopenharmony_ci */ 83661847f8eSopenharmony_ci CAPTURER_CHANNEL_2 = 0x1 << 1, 83761847f8eSopenharmony_ci /** 83861847f8eSopenharmony_ci * Capturer channel 3. 83961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 84061847f8eSopenharmony_ci * @systemapi 84161847f8eSopenharmony_ci * @since 12 84261847f8eSopenharmony_ci */ 84361847f8eSopenharmony_ci CAPTURER_CHANNEL_3 = 0x1 << 2, 84461847f8eSopenharmony_ci /** 84561847f8eSopenharmony_ci * Capturer channel 4. 84661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 84761847f8eSopenharmony_ci * @systemapi 84861847f8eSopenharmony_ci * @since 12 84961847f8eSopenharmony_ci */ 85061847f8eSopenharmony_ci CAPTURER_CHANNEL_4 = 0x1 << 3, 85161847f8eSopenharmony_ci } 85261847f8eSopenharmony_ci 85361847f8eSopenharmony_ci /** 85461847f8eSopenharmony_ci * Describes enroll callback information. 85561847f8eSopenharmony_ci * @typedef EnrollCallbackInfo 85661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 85761847f8eSopenharmony_ci * @systemapi 85861847f8eSopenharmony_ci * @since 10 85961847f8eSopenharmony_ci */ 86061847f8eSopenharmony_ci interface EnrollCallbackInfo { 86161847f8eSopenharmony_ci /** 86261847f8eSopenharmony_ci * Result. 86361847f8eSopenharmony_ci * @type { EnrollResult } 86461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 86561847f8eSopenharmony_ci * @systemapi 86661847f8eSopenharmony_ci * @since 10 86761847f8eSopenharmony_ci */ 86861847f8eSopenharmony_ci result: EnrollResult; 86961847f8eSopenharmony_ci /** 87061847f8eSopenharmony_ci * Describes enroll event context. 87161847f8eSopenharmony_ci * @type { string } 87261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 87361847f8eSopenharmony_ci * @systemapi 87461847f8eSopenharmony_ci * @since 10 87561847f8eSopenharmony_ci */ 87661847f8eSopenharmony_ci context: string; 87761847f8eSopenharmony_ci } 87861847f8eSopenharmony_ci 87961847f8eSopenharmony_ci /** 88061847f8eSopenharmony_ci * Describes wakeup intelligent voice engine callback information. 88161847f8eSopenharmony_ci * @typedef WakeupIntelligentVoiceEngineCallbackInfo 88261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 88361847f8eSopenharmony_ci * @systemapi 88461847f8eSopenharmony_ci * @since 10 88561847f8eSopenharmony_ci */ 88661847f8eSopenharmony_ci interface WakeupIntelligentVoiceEngineCallbackInfo { 88761847f8eSopenharmony_ci /** 88861847f8eSopenharmony_ci * Wakeup event id. 88961847f8eSopenharmony_ci * @type { WakeupIntelligentVoiceEventType } 89061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 89161847f8eSopenharmony_ci * @systemapi 89261847f8eSopenharmony_ci * @since 10 89361847f8eSopenharmony_ci */ 89461847f8eSopenharmony_ci eventId: WakeupIntelligentVoiceEventType; 89561847f8eSopenharmony_ci /** 89661847f8eSopenharmony_ci * Is success. 89761847f8eSopenharmony_ci * @type { boolean } 89861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 89961847f8eSopenharmony_ci * @systemapi 90061847f8eSopenharmony_ci * @since 10 90161847f8eSopenharmony_ci */ 90261847f8eSopenharmony_ci isSuccess: boolean; 90361847f8eSopenharmony_ci /** 90461847f8eSopenharmony_ci * Describes wakeup event context. 90561847f8eSopenharmony_ci * @type { string } 90661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 90761847f8eSopenharmony_ci * @systemapi 90861847f8eSopenharmony_ci * @since 10 90961847f8eSopenharmony_ci */ 91061847f8eSopenharmony_ci context: string; 91161847f8eSopenharmony_ci } 91261847f8eSopenharmony_ci 91361847f8eSopenharmony_ci /** 91461847f8eSopenharmony_ci * Implements enroll intelligent voice engine. 91561847f8eSopenharmony_ci * @typedef EnrollIntelligentVoiceEngine 91661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 91761847f8eSopenharmony_ci * @systemapi 91861847f8eSopenharmony_ci * @since 10 91961847f8eSopenharmony_ci */ 92061847f8eSopenharmony_ci interface EnrollIntelligentVoiceEngine { 92161847f8eSopenharmony_ci /** 92261847f8eSopenharmony_ci * Obtains the supported regions, This method uses an asynchronous callback to return the query result. 92361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 92461847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - the callback used to return the supported regions. 92561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 92661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 92761847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 92861847f8eSopenharmony_ci * @systemapi 92961847f8eSopenharmony_ci * @since 10 93061847f8eSopenharmony_ci */ 93161847f8eSopenharmony_ci getSupportedRegions(callback: AsyncCallback<Array<string>>): void; 93261847f8eSopenharmony_ci /** 93361847f8eSopenharmony_ci * Obtains the supported regions, This method uses a promise to return the query result. 93461847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 93561847f8eSopenharmony_ci * @returns { Promise<Array<string>> } the promise used to return the supported regions. 93661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 93761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 93861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 93961847f8eSopenharmony_ci * @systemapi 94061847f8eSopenharmony_ci * @since 10 94161847f8eSopenharmony_ci */ 94261847f8eSopenharmony_ci getSupportedRegions(): Promise<Array<string>>; 94361847f8eSopenharmony_ci /** 94461847f8eSopenharmony_ci * Initials the engine, This method uses an asynchronous callback to return the result. 94561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 94661847f8eSopenharmony_ci * @param { EnrollEngineConfig } config - config indicates enroll engine configuration. 94761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 94861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 94961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 95061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 95161847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 95261847f8eSopenharmony_ci * @throws { BusinessError } 22700103 - Init failed. 95361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 95461847f8eSopenharmony_ci * @systemapi 95561847f8eSopenharmony_ci * @since 10 95661847f8eSopenharmony_ci */ 95761847f8eSopenharmony_ci init(config: EnrollEngineConfig, callback: AsyncCallback<void>): void; 95861847f8eSopenharmony_ci /** 95961847f8eSopenharmony_ci * Initials the engine, This method uses a promise to return the result. 96061847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 96161847f8eSopenharmony_ci * @param { EnrollEngineConfig } config - config indicates enroll engine configuration. 96261847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 96361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 96461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 96561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 96661847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 96761847f8eSopenharmony_ci * @throws { BusinessError } 22700103 - Init failed. 96861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 96961847f8eSopenharmony_ci * @systemapi 97061847f8eSopenharmony_ci * @since 10 97161847f8eSopenharmony_ci */ 97261847f8eSopenharmony_ci init(config: EnrollEngineConfig): Promise<void>; 97361847f8eSopenharmony_ci /** 97461847f8eSopenharmony_ci * Enrolls for result, This method uses an asynchronous callback to return the result. 97561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 97661847f8eSopenharmony_ci * @param { boolean } isLast - isLast indicates if it is the last time to enroll. 97761847f8eSopenharmony_ci * @param { AsyncCallback<EnrollCallbackInfo> } callback - the callback used to return the result. 97861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 97961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 98061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 98161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 98261847f8eSopenharmony_ci * @systemapi 98361847f8eSopenharmony_ci * @since 10 98461847f8eSopenharmony_ci */ 98561847f8eSopenharmony_ci enrollForResult(isLast: boolean, callback: AsyncCallback<EnrollCallbackInfo>): void; 98661847f8eSopenharmony_ci /** 98761847f8eSopenharmony_ci * Enrolls for result, This method uses a promise to return the result. 98861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 98961847f8eSopenharmony_ci * @param { boolean } isLast - isLast indicates if it is the last time to enroll. 99061847f8eSopenharmony_ci * @returns { Promise<EnrollCallbackInfo> } the promise used to return the result. 99161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 99261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 99361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 99461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 99561847f8eSopenharmony_ci * @systemapi 99661847f8eSopenharmony_ci * @since 10 99761847f8eSopenharmony_ci */ 99861847f8eSopenharmony_ci enrollForResult(isLast: boolean): Promise<EnrollCallbackInfo>; 99961847f8eSopenharmony_ci /** 100061847f8eSopenharmony_ci * Stops the engine, This method uses an asynchronous callback to return the result. 100161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 100261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 100361847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 100461847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 100561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 100661847f8eSopenharmony_ci * @systemapi 100761847f8eSopenharmony_ci * @since 10 100861847f8eSopenharmony_ci */ 100961847f8eSopenharmony_ci stop(callback: AsyncCallback<void>): void; 101061847f8eSopenharmony_ci /** 101161847f8eSopenharmony_ci * Stops the engine, This method uses a promise to return the result. 101261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 101361847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 101461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 101561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 101661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 101761847f8eSopenharmony_ci * @systemapi 101861847f8eSopenharmony_ci * @since 10 101961847f8eSopenharmony_ci */ 102061847f8eSopenharmony_ci stop(): Promise<void>; 102161847f8eSopenharmony_ci /** 102261847f8eSopenharmony_ci * Commit enroll, This method uses an asynchronous callback to return the result. 102361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 102461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 102561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 102661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 102761847f8eSopenharmony_ci * @throws { BusinessError } 22700104 - Failed to commit the enrollment. 102861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 102961847f8eSopenharmony_ci * @systemapi 103061847f8eSopenharmony_ci * @since 10 103161847f8eSopenharmony_ci */ 103261847f8eSopenharmony_ci commit(callback: AsyncCallback<void>): void; 103361847f8eSopenharmony_ci /** 103461847f8eSopenharmony_ci * Commit enroll, This method uses a promise to return the result. 103561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 103661847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 103761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 103861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 103961847f8eSopenharmony_ci * @throws { BusinessError } 22700104 - Failed to commit the enrollment. 104061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 104161847f8eSopenharmony_ci * @systemapi 104261847f8eSopenharmony_ci * @since 10 104361847f8eSopenharmony_ci */ 104461847f8eSopenharmony_ci commit(): Promise<void>; 104561847f8eSopenharmony_ci /** 104661847f8eSopenharmony_ci * Sets wakeup hap information, This method uses an asynchronous callback to return the result. 104761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 104861847f8eSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 104961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 105061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 105161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 105261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 105361847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 105461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 105561847f8eSopenharmony_ci * @systemapi 105661847f8eSopenharmony_ci * @since 10 105761847f8eSopenharmony_ci */ 105861847f8eSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo, callback: AsyncCallback<void>): void; 105961847f8eSopenharmony_ci /** 106061847f8eSopenharmony_ci * Sets wakeup hap information, This method uses a promise to return the result. 106161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 106261847f8eSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 106361847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 106461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 106561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 106661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 106761847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 106861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 106961847f8eSopenharmony_ci * @systemapi 107061847f8eSopenharmony_ci * @since 10 107161847f8eSopenharmony_ci */ 107261847f8eSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo): Promise<void>; 107361847f8eSopenharmony_ci /** 107461847f8eSopenharmony_ci * Sets sensibility, This method uses an asynchronous callback to return the result. 107561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 107661847f8eSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 107761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 107861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 107961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 108061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 108161847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 108261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 108361847f8eSopenharmony_ci * @systemapi 108461847f8eSopenharmony_ci * @since 10 108561847f8eSopenharmony_ci */ 108661847f8eSopenharmony_ci setSensibility(sensibility: SensibilityType, callback: AsyncCallback<void>): void; 108761847f8eSopenharmony_ci /** 108861847f8eSopenharmony_ci * Sets sensibility, This method uses a promise to return the result. 108961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 109061847f8eSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 109161847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 109261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 109361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 109461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 109561847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 109661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 109761847f8eSopenharmony_ci * @systemapi 109861847f8eSopenharmony_ci * @since 10 109961847f8eSopenharmony_ci */ 110061847f8eSopenharmony_ci setSensibility(sensibility: SensibilityType): Promise<void>; 110161847f8eSopenharmony_ci /** 110261847f8eSopenharmony_ci * Sets an intelligent voice parameter. This method uses an asynchronous callback to return the result. 110361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 110461847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 110561847f8eSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 110661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 110761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 110861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 110961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 111061847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 111161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 111261847f8eSopenharmony_ci * @systemapi 111361847f8eSopenharmony_ci * @since 10 111461847f8eSopenharmony_ci */ 111561847f8eSopenharmony_ci setParameter(key: string, value: string, callback: AsyncCallback<void>): void; 111661847f8eSopenharmony_ci /** 111761847f8eSopenharmony_ci * Sets an intelligent voice parameter. This method uses a promise to return the result. 111861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 111961847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 112061847f8eSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 112161847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 112261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 112361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 112461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 112561847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 112661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 112761847f8eSopenharmony_ci * @systemapi 112861847f8eSopenharmony_ci * @since 10 112961847f8eSopenharmony_ci */ 113061847f8eSopenharmony_ci setParameter(key: string, value: string): Promise<void>; 113161847f8eSopenharmony_ci /** 113261847f8eSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses an asynchronous callback to return the query result. 113361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 113461847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 113561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback used to return the value of the intelligent voice parameter. 113661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 113761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 113861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 113961847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 114061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 114161847f8eSopenharmony_ci * @systemapi 114261847f8eSopenharmony_ci * @since 10 114361847f8eSopenharmony_ci */ 114461847f8eSopenharmony_ci getParameter(key: string, callback: AsyncCallback<string>): void; 114561847f8eSopenharmony_ci /** 114661847f8eSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result. 114761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 114861847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 114961847f8eSopenharmony_ci * @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter. 115061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 115161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 115261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 115361847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 115461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 115561847f8eSopenharmony_ci * @systemapi 115661847f8eSopenharmony_ci * @since 10 115761847f8eSopenharmony_ci */ 115861847f8eSopenharmony_ci getParameter(key: string): Promise<string>; 115961847f8eSopenharmony_ci /** 116061847f8eSopenharmony_ci * Evaluates for result, This method uses a promise to return the result. 116161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 116261847f8eSopenharmony_ci * @param { string } word - the word to evaluate. 116361847f8eSopenharmony_ci * @returns { Promise<EvaluationResult> } the promise used to return the result. 116461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 116561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 116661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 116761847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 116861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 116961847f8eSopenharmony_ci * @systemapi 117061847f8eSopenharmony_ci * @since 12 117161847f8eSopenharmony_ci */ 117261847f8eSopenharmony_ci evaluateForResult(word: string): Promise<EvaluationResult>; 117361847f8eSopenharmony_ci /** 117461847f8eSopenharmony_ci * Releases the engine, This method uses an asynchronous callback to return the result. 117561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 117661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 117761847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 117861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 117961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 118061847f8eSopenharmony_ci * @systemapi 118161847f8eSopenharmony_ci * @since 10 118261847f8eSopenharmony_ci */ 118361847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 118461847f8eSopenharmony_ci /** 118561847f8eSopenharmony_ci * Releases the engine, This method uses a promise to return the result. 118661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 118761847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 118861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 118961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 119061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 119161847f8eSopenharmony_ci * @systemapi 119261847f8eSopenharmony_ci * @since 10 119361847f8eSopenharmony_ci */ 119461847f8eSopenharmony_ci release(): Promise<void>; 119561847f8eSopenharmony_ci } 119661847f8eSopenharmony_ci 119761847f8eSopenharmony_ci /** 119861847f8eSopenharmony_ci * Implements wakeup intelligent voice engine. 119961847f8eSopenharmony_ci * @typedef WakeupIntelligentVoiceEngine 120061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 120161847f8eSopenharmony_ci * @systemapi 120261847f8eSopenharmony_ci * @since 10 120361847f8eSopenharmony_ci */ 120461847f8eSopenharmony_ci interface WakeupIntelligentVoiceEngine { 120561847f8eSopenharmony_ci /** 120661847f8eSopenharmony_ci * Obtains the supported regions, This method uses an asynchronous callback to return the query result. 120761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 120861847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - the callback used to return the supported regions. 120961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 121061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 121161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 121261847f8eSopenharmony_ci * @systemapi 121361847f8eSopenharmony_ci * @since 10 121461847f8eSopenharmony_ci */ 121561847f8eSopenharmony_ci getSupportedRegions(callback: AsyncCallback<Array<string>>): void; 121661847f8eSopenharmony_ci /** 121761847f8eSopenharmony_ci * Obtains the supported regions, This method uses a promise to return the query result. 121861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 121961847f8eSopenharmony_ci * @returns { Promise<Array<string>> } the promise used to return the supported regions. 122061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 122161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 122261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 122361847f8eSopenharmony_ci * @systemapi 122461847f8eSopenharmony_ci * @since 10 122561847f8eSopenharmony_ci */ 122661847f8eSopenharmony_ci getSupportedRegions(): Promise<Array<string>>; 122761847f8eSopenharmony_ci /** 122861847f8eSopenharmony_ci * Sets wakeup hap information, This method uses an asynchronous callback to return the result. 122961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 123061847f8eSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 123161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 123261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 123361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 123461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 123561847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 123661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 123761847f8eSopenharmony_ci * @systemapi 123861847f8eSopenharmony_ci * @since 10 123961847f8eSopenharmony_ci */ 124061847f8eSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo, callback: AsyncCallback<void>): void; 124161847f8eSopenharmony_ci /** 124261847f8eSopenharmony_ci * Sets wakeup hap information, This method uses a promise to return the result. 124361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 124461847f8eSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 124561847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 124661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 124761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 124861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 124961847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 125061847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 125161847f8eSopenharmony_ci * @systemapi 125261847f8eSopenharmony_ci * @since 10 125361847f8eSopenharmony_ci */ 125461847f8eSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo): Promise<void>; 125561847f8eSopenharmony_ci /** 125661847f8eSopenharmony_ci * Sets sensibility, This method uses an asynchronous callback to return the result. 125761847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 125861847f8eSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 125961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 126061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 126161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 126261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 126361847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 126461847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 126561847f8eSopenharmony_ci * @systemapi 126661847f8eSopenharmony_ci * @since 10 126761847f8eSopenharmony_ci */ 126861847f8eSopenharmony_ci setSensibility(sensibility: SensibilityType, callback: AsyncCallback<void>): void; 126961847f8eSopenharmony_ci /** 127061847f8eSopenharmony_ci * Sets sensibility, This method uses a promise to return the result. 127161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 127261847f8eSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 127361847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 127461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 127561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 127661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 127761847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 127861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 127961847f8eSopenharmony_ci * @systemapi 128061847f8eSopenharmony_ci * @since 10 128161847f8eSopenharmony_ci */ 128261847f8eSopenharmony_ci setSensibility(sensibility: SensibilityType): Promise<void>; 128361847f8eSopenharmony_ci /** 128461847f8eSopenharmony_ci * Sets an intelligent voice parameter. This method uses an asynchronous callback to return the result. 128561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 128661847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 128761847f8eSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 128861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 128961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 129061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 129161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 129261847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 129361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 129461847f8eSopenharmony_ci * @systemapi 129561847f8eSopenharmony_ci * @since 10 129661847f8eSopenharmony_ci */ 129761847f8eSopenharmony_ci setParameter(key: string, value: string, callback: AsyncCallback<void>): void; 129861847f8eSopenharmony_ci /** 129961847f8eSopenharmony_ci * Sets an intelligent voice parameter. This method uses a promise to return the result. 130061847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 130161847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 130261847f8eSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 130361847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 130461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 130561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 130661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 130761847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 130861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 130961847f8eSopenharmony_ci * @systemapi 131061847f8eSopenharmony_ci * @since 10 131161847f8eSopenharmony_ci */ 131261847f8eSopenharmony_ci setParameter(key: string, value: string): Promise<void>; 131361847f8eSopenharmony_ci /** 131461847f8eSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses an asynchronous callback to return the query result. 131561847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 131661847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 131761847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback used to return the value of the intelligent voice parameter. 131861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 131961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 132061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 132161847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 132261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 132361847f8eSopenharmony_ci * @systemapi 132461847f8eSopenharmony_ci * @since 10 132561847f8eSopenharmony_ci */ 132661847f8eSopenharmony_ci getParameter(key: string, callback: AsyncCallback<string>): void; 132761847f8eSopenharmony_ci /** 132861847f8eSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result. 132961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 133061847f8eSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 133161847f8eSopenharmony_ci * @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter. 133261847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 133361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 133461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 133561847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 133661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 133761847f8eSopenharmony_ci * @systemapi 133861847f8eSopenharmony_ci * @since 10 133961847f8eSopenharmony_ci */ 134061847f8eSopenharmony_ci getParameter(key: string): Promise<string>; 134161847f8eSopenharmony_ci /** 134261847f8eSopenharmony_ci * Gets pulse-code modulation audio. This method uses a promise to return the result. 134361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 134461847f8eSopenharmony_ci * @returns { Promise<ArrayBuffer> } the promise used to return the pulse-code modulation audio. 134561847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 134661847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 134761847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 134861847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 134961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 135061847f8eSopenharmony_ci * @systemapi 135161847f8eSopenharmony_ci * @since 12 135261847f8eSopenharmony_ci */ 135361847f8eSopenharmony_ci getPcm(): Promise<ArrayBuffer>; 135461847f8eSopenharmony_ci /** 135561847f8eSopenharmony_ci * Starts the capturer. This method uses a promise to return the result. 135661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 135761847f8eSopenharmony_ci * @param { number } channels - the channels needed in reading. The channels should be greater than 0 and smaller than 16. 135861847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 135961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 136061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 136161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3.Parameter verification failed. 136261847f8eSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 136361847f8eSopenharmony_ci * @throws { BusinessError } 22700105 - Start capturer failed. 136461847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 136561847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 136661847f8eSopenharmony_ci * @systemapi 136761847f8eSopenharmony_ci * @since 12 136861847f8eSopenharmony_ci */ 136961847f8eSopenharmony_ci startCapturer(channels: number): Promise<void>; 137061847f8eSopenharmony_ci /** 137161847f8eSopenharmony_ci * Reads the buffer from wakeup engine. This method uses a promise to return the result. 137261847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 137361847f8eSopenharmony_ci * @returns { Promise<ArrayBuffer> } the promise used to return the buffer. 137461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 137561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 137661847f8eSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 137761847f8eSopenharmony_ci * @throws { BusinessError } 22700106 - Read failed. 137861847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 137961847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 138061847f8eSopenharmony_ci * @systemapi 138161847f8eSopenharmony_ci * @since 12 138261847f8eSopenharmony_ci */ 138361847f8eSopenharmony_ci read(): Promise<ArrayBuffer>; 138461847f8eSopenharmony_ci /** 138561847f8eSopenharmony_ci * Stops the capturer. This method uses a promise to return the result. 138661847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 138761847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 138861847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 138961847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 139061847f8eSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 139161847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 139261847f8eSopenharmony_ci * @systemapi 139361847f8eSopenharmony_ci * @since 12 139461847f8eSopenharmony_ci */ 139561847f8eSopenharmony_ci stopCapturer(): Promise<void>; 139661847f8eSopenharmony_ci /** 139761847f8eSopenharmony_ci * Releases the engine, This method uses an asynchronous callback to return the result. 139861847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 139961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 140061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 140161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 140261847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 140361847f8eSopenharmony_ci * @systemapi 140461847f8eSopenharmony_ci * @since 10 140561847f8eSopenharmony_ci */ 140661847f8eSopenharmony_ci release(callback: AsyncCallback<void>): void; 140761847f8eSopenharmony_ci /** 140861847f8eSopenharmony_ci * Releases the engine, This method uses a promise to return the result. 140961847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 141061847f8eSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 141161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 141261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 141361847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 141461847f8eSopenharmony_ci * @systemapi 141561847f8eSopenharmony_ci * @since 10 141661847f8eSopenharmony_ci */ 141761847f8eSopenharmony_ci release(): Promise<void>; 141861847f8eSopenharmony_ci /** 141961847f8eSopenharmony_ci * Subscribes wakeup intelligent voice events. When wakeup intelligent voice events reach, 142061847f8eSopenharmony_ci * the callback is invoked. 142161847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 142261847f8eSopenharmony_ci * @param { 'wakeupIntelligentVoiceEvent' } type - Type of the event to listen for. Only the wakeupIntelligentVoice event is supported. 142361847f8eSopenharmony_ci * @param { Callback<WakeupIntelligentVoiceEngineCallbackInfo> } callback - the callback invoked when the event is triggered. 142461847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 142561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 142661847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 142761847f8eSopenharmony_ci * @systemapi 142861847f8eSopenharmony_ci * @since 10 142961847f8eSopenharmony_ci */ 143061847f8eSopenharmony_ci on(type: 'wakeupIntelligentVoiceEvent', callback: Callback<WakeupIntelligentVoiceEngineCallbackInfo>): void; 143161847f8eSopenharmony_ci /** 143261847f8eSopenharmony_ci * Unsubscribes wakeup intelligent voice events. 143361847f8eSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 143461847f8eSopenharmony_ci * @param { 'wakeupIntelligentVoiceEvent' } type - Type of the event to listen for. Only the wakeupIntelligentVoice event is supported. 143561847f8eSopenharmony_ci * @param { Callback<WakeupIntelligentVoiceEngineCallbackInfo> } [callback] - the callback invoked when the event is triggered. 143661847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 143761847f8eSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 143861847f8eSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 143961847f8eSopenharmony_ci * @systemapi 144061847f8eSopenharmony_ci * @since 10 144161847f8eSopenharmony_ci */ 144261847f8eSopenharmony_ci off(type: 'wakeupIntelligentVoiceEvent', callback?: Callback<WakeupIntelligentVoiceEngineCallbackInfo>): void; 144361847f8eSopenharmony_ci } 144461847f8eSopenharmony_ci} 144561847f8eSopenharmony_ci 144661847f8eSopenharmony_ciexport default intelligentVoice;