15490a39dSopenharmony_ci/* 25490a39dSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 35490a39dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 45490a39dSopenharmony_ci * you may not use this file except in compliance with the License. 55490a39dSopenharmony_ci * You may obtain a copy of the License at 65490a39dSopenharmony_ci * 75490a39dSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 85490a39dSopenharmony_ci * 95490a39dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 105490a39dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 115490a39dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 125490a39dSopenharmony_ci * See the License for the specific language governing permissions and 135490a39dSopenharmony_ci * limitations under the License. 145490a39dSopenharmony_ci */ 155490a39dSopenharmony_ci 165490a39dSopenharmony_ci/** 175490a39dSopenharmony_ci * @file 185490a39dSopenharmony_ci * @kit BasicServicesKit 195490a39dSopenharmony_ci */ 205490a39dSopenharmony_ci 215490a39dSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base'; 225490a39dSopenharmony_ci 235490a39dSopenharmony_ci/** 245490a39dSopenharmony_ci * @namespace intelligentVoice 255490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 265490a39dSopenharmony_ci * @systemapi 275490a39dSopenharmony_ci * @since 10 285490a39dSopenharmony_ci */ 295490a39dSopenharmony_cideclare namespace intelligentVoice { 305490a39dSopenharmony_ci /** 315490a39dSopenharmony_ci * Obtains an {@link IntelligentVoiceManager} instance. 325490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 335490a39dSopenharmony_ci * @returns { IntelligentVoiceManager } this {@link IntelligentVoiceManager} object. 345490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 355490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 365490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 375490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 385490a39dSopenharmony_ci * @systemapi 395490a39dSopenharmony_ci * @since 10 405490a39dSopenharmony_ci */ 415490a39dSopenharmony_ci function getIntelligentVoiceManager(): IntelligentVoiceManager; 425490a39dSopenharmony_ci 435490a39dSopenharmony_ci /** 445490a39dSopenharmony_ci * Implements intelligent voice management. 455490a39dSopenharmony_ci * @typedef IntelligentVoiceManager 465490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 475490a39dSopenharmony_ci * @systemapi 485490a39dSopenharmony_ci * @since 10 495490a39dSopenharmony_ci */ 505490a39dSopenharmony_ci interface IntelligentVoiceManager { 515490a39dSopenharmony_ci /** 525490a39dSopenharmony_ci * Obtains capability information. 535490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 545490a39dSopenharmony_ci * @returns { Array<IntelligentVoiceEngineType> } array of supported IntelligentVoiceEngineType. 555490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 565490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 575490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 585490a39dSopenharmony_ci * @systemapi 595490a39dSopenharmony_ci * @since 10 605490a39dSopenharmony_ci */ 615490a39dSopenharmony_ci getCapabilityInfo(): Array<IntelligentVoiceEngineType>; 625490a39dSopenharmony_ci /** 635490a39dSopenharmony_ci * Subscribes service change events. When the state of intelligent voice service changes, 645490a39dSopenharmony_ci * the callback is invoked. 655490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 665490a39dSopenharmony_ci * @param { 'serviceChange' } type - Type of the event to listen for. Only the serviceChange event is supported. 675490a39dSopenharmony_ci * @param { Callback<ServiceChangeType> } callback - Callback is invoked when the event is triggered. 685490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 695490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 705490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 715490a39dSopenharmony_ci * @systemapi 725490a39dSopenharmony_ci * @since 10 735490a39dSopenharmony_ci */ 745490a39dSopenharmony_ci on(type: 'serviceChange', callback: Callback<ServiceChangeType>): void; 755490a39dSopenharmony_ci /** 765490a39dSopenharmony_ci * Unsubscribes service change events. 775490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 785490a39dSopenharmony_ci * @param { 'serviceChange' } type - Type of the event to listen for. Only the serviceChange event is supported. 795490a39dSopenharmony_ci * @param { Callback<ServiceChangeType> } [callback] - Callback is invoked when the event is triggered. 805490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 815490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 825490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 835490a39dSopenharmony_ci * @systemapi 845490a39dSopenharmony_ci * @since 10 855490a39dSopenharmony_ci */ 865490a39dSopenharmony_ci off(type: 'serviceChange', callback?: Callback<ServiceChangeType>): void; 875490a39dSopenharmony_ci } 885490a39dSopenharmony_ci 895490a39dSopenharmony_ci /** 905490a39dSopenharmony_ci * Implements wakeup management. 915490a39dSopenharmony_ci * @typedef WakeupManager 925490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 935490a39dSopenharmony_ci * @systemapi 945490a39dSopenharmony_ci * @since 12 955490a39dSopenharmony_ci */ 965490a39dSopenharmony_ci interface WakeupManager { 975490a39dSopenharmony_ci /** 985490a39dSopenharmony_ci * Sets an intelligent voice parameter. This method uses a promise to return the result. 995490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 1005490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 1015490a39dSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 1025490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 1035490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 1045490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 1055490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 1065490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 1075490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 1085490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1095490a39dSopenharmony_ci * @systemapi 1105490a39dSopenharmony_ci * @since 12 1115490a39dSopenharmony_ci */ 1125490a39dSopenharmony_ci setParameter(key: string, value: string): Promise<void>; 1135490a39dSopenharmony_ci /** 1145490a39dSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result. 1155490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 1165490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 1175490a39dSopenharmony_ci * @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter. 1185490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 1195490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 1205490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 1215490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 1225490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 1235490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1245490a39dSopenharmony_ci * @systemapi 1255490a39dSopenharmony_ci * @since 12 1265490a39dSopenharmony_ci */ 1275490a39dSopenharmony_ci getParameter(key: string): Promise<string>; 1285490a39dSopenharmony_ci /** 1295490a39dSopenharmony_ci * Obtains files needed to upload. This method uses a promise to return the files needed to upload. 1305490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 1315490a39dSopenharmony_ci * @param { number } maxCount - the maximum count of upload files. The maxCount should be greater than 0 and smaller than 101 1325490a39dSopenharmony_ci * @returns { Promise<Array<UploadFile>> } the promise used to return the upload files. 1335490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 1345490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 1355490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3.Parameter verification failed. 1365490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 1375490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 1385490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 1395490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1405490a39dSopenharmony_ci * @systemapi 1415490a39dSopenharmony_ci * @since 12 1425490a39dSopenharmony_ci */ 1435490a39dSopenharmony_ci getUploadFiles (maxCount: number): Promise<Array<UploadFile>>; 1445490a39dSopenharmony_ci /** 1455490a39dSopenharmony_ci * Obtains wakeup source files. This method uses a promise to return the wakeup source files. 1465490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 1475490a39dSopenharmony_ci * @returns { Promise<Array<WakeupSourceFile>> } the promise used to return the wakeup source files. 1485490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 1495490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 1505490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 1515490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 1525490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1535490a39dSopenharmony_ci * @systemapi 1545490a39dSopenharmony_ci * @since 12 1555490a39dSopenharmony_ci */ 1565490a39dSopenharmony_ci getWakeupSourceFiles(): Promise<Array<WakeupSourceFile>>; 1575490a39dSopenharmony_ci /** 1585490a39dSopenharmony_ci * Enrolls with wakeup files for result. This method uses a promise to return the enroll result. 1595490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 1605490a39dSopenharmony_ci * @param { Array<WakeupSourceFile> } wakeupFiles - the wakeup source files needed. 1615490a39dSopenharmony_ci * @param { string } wakeupInfo - wakeup information. 1625490a39dSopenharmony_ci * @returns { Promise<EnrollResult> } the promise used to return the enroll result. 1635490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 1645490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 1655490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 1665490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 1675490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 1685490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 1695490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1705490a39dSopenharmony_ci * @systemapi 1715490a39dSopenharmony_ci * @since 12 1725490a39dSopenharmony_ci */ 1735490a39dSopenharmony_ci enrollWithWakeupFilesForResult(wakeupFiles: Array<WakeupSourceFile>, wakeupInfo: string): Promise<EnrollResult>; 1745490a39dSopenharmony_ci /** 1755490a39dSopenharmony_ci * Clears user data. 1765490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 1775490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 1785490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 1795490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 1805490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 1815490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1825490a39dSopenharmony_ci * @systemapi 1835490a39dSopenharmony_ci * @since 12 1845490a39dSopenharmony_ci */ 1855490a39dSopenharmony_ci clearUserData(): Promise<void>; 1865490a39dSopenharmony_ci } 1875490a39dSopenharmony_ci 1885490a39dSopenharmony_ci /** 1895490a39dSopenharmony_ci * Enumerates upload file type. 1905490a39dSopenharmony_ci * @enum {number} 1915490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1925490a39dSopenharmony_ci * @systemapi 1935490a39dSopenharmony_ci * @since 12 1945490a39dSopenharmony_ci */ 1955490a39dSopenharmony_ci enum UploadFileType { 1965490a39dSopenharmony_ci /** 1975490a39dSopenharmony_ci * Enroll file. 1985490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 1995490a39dSopenharmony_ci * @systemapi 2005490a39dSopenharmony_ci * @since 12 2015490a39dSopenharmony_ci */ 2025490a39dSopenharmony_ci ENROLL_FILE = 0, 2035490a39dSopenharmony_ci /** 2045490a39dSopenharmony_ci * Wakeup file. 2055490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2065490a39dSopenharmony_ci * @systemapi 2075490a39dSopenharmony_ci * @since 12 2085490a39dSopenharmony_ci */ 2095490a39dSopenharmony_ci WAKEUP_FILE = 1, 2105490a39dSopenharmony_ci } 2115490a39dSopenharmony_ci 2125490a39dSopenharmony_ci /** 2135490a39dSopenharmony_ci * Describes upload file information. 2145490a39dSopenharmony_ci * @typedef UploadFile 2155490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2165490a39dSopenharmony_ci * @systemapi 2175490a39dSopenharmony_ci * @since 12 2185490a39dSopenharmony_ci */ 2195490a39dSopenharmony_ci interface UploadFile { 2205490a39dSopenharmony_ci /** 2215490a39dSopenharmony_ci * Report file type. 2225490a39dSopenharmony_ci * @type { UploadFileType } 2235490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2245490a39dSopenharmony_ci * @systemapi 2255490a39dSopenharmony_ci * @since 12 2265490a39dSopenharmony_ci */ 2275490a39dSopenharmony_ci type: UploadFileType; 2285490a39dSopenharmony_ci /** 2295490a39dSopenharmony_ci * Files description. 2305490a39dSopenharmony_ci * @type { string } 2315490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2325490a39dSopenharmony_ci * @systemapi 2335490a39dSopenharmony_ci * @since 12 2345490a39dSopenharmony_ci */ 2355490a39dSopenharmony_ci filesDescription: string; 2365490a39dSopenharmony_ci /** 2375490a39dSopenharmony_ci * Files content. 2385490a39dSopenharmony_ci * @type { Array<ArrayBuffer> } 2395490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2405490a39dSopenharmony_ci * @systemapi 2415490a39dSopenharmony_ci * @since 12 2425490a39dSopenharmony_ci */ 2435490a39dSopenharmony_ci filesContent: Array<ArrayBuffer>; 2445490a39dSopenharmony_ci } 2455490a39dSopenharmony_ci 2465490a39dSopenharmony_ci /** 2475490a39dSopenharmony_ci * Describes wakeup source file information. 2485490a39dSopenharmony_ci * @typedef WakeupSourceFile 2495490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2505490a39dSopenharmony_ci * @systemapi 2515490a39dSopenharmony_ci * @since 12 2525490a39dSopenharmony_ci */ 2535490a39dSopenharmony_ci interface WakeupSourceFile { 2545490a39dSopenharmony_ci /** 2555490a39dSopenharmony_ci * File path. 2565490a39dSopenharmony_ci * @type { string } 2575490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2585490a39dSopenharmony_ci * @systemapi 2595490a39dSopenharmony_ci * @since 12 2605490a39dSopenharmony_ci */ 2615490a39dSopenharmony_ci filePath: string; 2625490a39dSopenharmony_ci /** 2635490a39dSopenharmony_ci * File content. 2645490a39dSopenharmony_ci * @type { ArrayBuffer } 2655490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2665490a39dSopenharmony_ci * @systemapi 2675490a39dSopenharmony_ci * @since 12 2685490a39dSopenharmony_ci */ 2695490a39dSopenharmony_ci fileContent: ArrayBuffer; 2705490a39dSopenharmony_ci } 2715490a39dSopenharmony_ci 2725490a39dSopenharmony_ci /** 2735490a39dSopenharmony_ci * Enumerates service change type. 2745490a39dSopenharmony_ci * @enum {number} 2755490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2765490a39dSopenharmony_ci * @systemapi 2775490a39dSopenharmony_ci * @since 10 2785490a39dSopenharmony_ci */ 2795490a39dSopenharmony_ci enum ServiceChangeType { 2805490a39dSopenharmony_ci /** 2815490a39dSopenharmony_ci * Service unavailable. 2825490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2835490a39dSopenharmony_ci * @systemapi 2845490a39dSopenharmony_ci * @since 10 2855490a39dSopenharmony_ci */ 2865490a39dSopenharmony_ci SERVICE_UNAVAILABLE = 0, 2875490a39dSopenharmony_ci } 2885490a39dSopenharmony_ci 2895490a39dSopenharmony_ci /** 2905490a39dSopenharmony_ci * Enumerates intelligent voice engine type. 2915490a39dSopenharmony_ci * @enum {number} 2925490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 2935490a39dSopenharmony_ci * @systemapi 2945490a39dSopenharmony_ci * @since 10 2955490a39dSopenharmony_ci */ 2965490a39dSopenharmony_ci enum IntelligentVoiceEngineType { 2975490a39dSopenharmony_ci /** 2985490a39dSopenharmony_ci * Enroll engine. 2995490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3005490a39dSopenharmony_ci * @systemapi 3015490a39dSopenharmony_ci * @since 10 3025490a39dSopenharmony_ci */ 3035490a39dSopenharmony_ci ENROLL_ENGINE_TYPE = 0, 3045490a39dSopenharmony_ci /** 3055490a39dSopenharmony_ci * Wakeup engine. 3065490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3075490a39dSopenharmony_ci * @systemapi 3085490a39dSopenharmony_ci * @since 10 3095490a39dSopenharmony_ci */ 3105490a39dSopenharmony_ci WAKEUP_ENGINE_TYPE = 1, 3115490a39dSopenharmony_ci /** 3125490a39dSopenharmony_ci * Update engine. 3135490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3145490a39dSopenharmony_ci * @systemapi 3155490a39dSopenharmony_ci * @since 10 3165490a39dSopenharmony_ci */ 3175490a39dSopenharmony_ci UPDATE_ENGINE_TYPE = 2, 3185490a39dSopenharmony_ci } 3195490a39dSopenharmony_ci 3205490a39dSopenharmony_ci /** 3215490a39dSopenharmony_ci * Describes enroll intelligent voice engine. 3225490a39dSopenharmony_ci * @typedef EnrollIntelligentVoiceEngineDescriptor 3235490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3245490a39dSopenharmony_ci * @systemapi 3255490a39dSopenharmony_ci * @since 10 3265490a39dSopenharmony_ci */ 3275490a39dSopenharmony_ci interface EnrollIntelligentVoiceEngineDescriptor { 3285490a39dSopenharmony_ci /** 3295490a39dSopenharmony_ci * Wakeup phrase. 3305490a39dSopenharmony_ci * @type { string } 3315490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3325490a39dSopenharmony_ci * @systemapi 3335490a39dSopenharmony_ci * @since 10 3345490a39dSopenharmony_ci */ 3355490a39dSopenharmony_ci wakeupPhrase: string; 3365490a39dSopenharmony_ci } 3375490a39dSopenharmony_ci 3385490a39dSopenharmony_ci /** 3395490a39dSopenharmony_ci * Describes wakeup intelligent voice engine. 3405490a39dSopenharmony_ci * @typedef WakeupIntelligentVoiceEngineDescriptor 3415490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3425490a39dSopenharmony_ci * @systemapi 3435490a39dSopenharmony_ci * @since 10 3445490a39dSopenharmony_ci */ 3455490a39dSopenharmony_ci interface WakeupIntelligentVoiceEngineDescriptor { 3465490a39dSopenharmony_ci /** 3475490a39dSopenharmony_ci * Need reconfirm. 3485490a39dSopenharmony_ci * @type { boolean } 3495490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3505490a39dSopenharmony_ci * @systemapi 3515490a39dSopenharmony_ci * @since 10 3525490a39dSopenharmony_ci */ 3535490a39dSopenharmony_ci needReconfirm: boolean; 3545490a39dSopenharmony_ci /** 3555490a39dSopenharmony_ci * Wakeup phrase. 3565490a39dSopenharmony_ci * @type { string } 3575490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3585490a39dSopenharmony_ci * @systemapi 3595490a39dSopenharmony_ci * @since 10 3605490a39dSopenharmony_ci */ 3615490a39dSopenharmony_ci wakeupPhrase: string; 3625490a39dSopenharmony_ci } 3635490a39dSopenharmony_ci 3645490a39dSopenharmony_ci /** 3655490a39dSopenharmony_ci * Enumerates evaluation result code. 3665490a39dSopenharmony_ci * @enum {number} 3675490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3685490a39dSopenharmony_ci * @systemapi 3695490a39dSopenharmony_ci * @since 12 3705490a39dSopenharmony_ci */ 3715490a39dSopenharmony_ci enum EvaluationResultCode { 3725490a39dSopenharmony_ci /** 3735490a39dSopenharmony_ci * Unknown. 3745490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3755490a39dSopenharmony_ci * @systemapi 3765490a39dSopenharmony_ci * @since 12 3775490a39dSopenharmony_ci */ 3785490a39dSopenharmony_ci UNKNOWN = 0, 3795490a39dSopenharmony_ci /** 3805490a39dSopenharmony_ci * Pass. 3815490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3825490a39dSopenharmony_ci * @systemapi 3835490a39dSopenharmony_ci * @since 12 3845490a39dSopenharmony_ci */ 3855490a39dSopenharmony_ci PASS = 1, 3865490a39dSopenharmony_ci /** 3875490a39dSopenharmony_ci * Word is empty. 3885490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3895490a39dSopenharmony_ci * @systemapi 3905490a39dSopenharmony_ci * @since 12 3915490a39dSopenharmony_ci */ 3925490a39dSopenharmony_ci WORD_EMPTY = 2, 3935490a39dSopenharmony_ci /** 3945490a39dSopenharmony_ci * Only chinese is supported. 3955490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 3965490a39dSopenharmony_ci * @systemapi 3975490a39dSopenharmony_ci * @since 12 3985490a39dSopenharmony_ci */ 3995490a39dSopenharmony_ci CHINESE_ONLY = 3, 4005490a39dSopenharmony_ci /** 4015490a39dSopenharmony_ci * Invalid length. 4025490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4035490a39dSopenharmony_ci * @systemapi 4045490a39dSopenharmony_ci * @since 12 4055490a39dSopenharmony_ci */ 4065490a39dSopenharmony_ci INVALID_LENGTH = 4, 4075490a39dSopenharmony_ci /** 4085490a39dSopenharmony_ci * Unusual word. 4095490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4105490a39dSopenharmony_ci * @systemapi 4115490a39dSopenharmony_ci * @since 12 4125490a39dSopenharmony_ci */ 4135490a39dSopenharmony_ci UNUSUAL_WORD = 5, 4145490a39dSopenharmony_ci /** 4155490a39dSopenharmony_ci * Consecutive same word. 4165490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4175490a39dSopenharmony_ci * @systemapi 4185490a39dSopenharmony_ci * @since 12 4195490a39dSopenharmony_ci */ 4205490a39dSopenharmony_ci CONSECUTIVE_SAME_WORD = 6, 4215490a39dSopenharmony_ci /** 4225490a39dSopenharmony_ci * Too few phonemes. 4235490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4245490a39dSopenharmony_ci * @systemapi 4255490a39dSopenharmony_ci * @since 12 4265490a39dSopenharmony_ci */ 4275490a39dSopenharmony_ci TOO_FEW_PHONEMES = 7, 4285490a39dSopenharmony_ci /** 4295490a39dSopenharmony_ci * Too many phonemes. 4305490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4315490a39dSopenharmony_ci * @systemapi 4325490a39dSopenharmony_ci * @since 12 4335490a39dSopenharmony_ci */ 4345490a39dSopenharmony_ci TOO_MANY_PHONEMES = 8, 4355490a39dSopenharmony_ci /** 4365490a39dSopenharmony_ci * Contain common instruction. 4375490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4385490a39dSopenharmony_ci * @systemapi 4395490a39dSopenharmony_ci * @since 12 4405490a39dSopenharmony_ci */ 4415490a39dSopenharmony_ci COMMON_INSTRUCTION = 9, 4425490a39dSopenharmony_ci /** 4435490a39dSopenharmony_ci * Contain common spoken language. 4445490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4455490a39dSopenharmony_ci * @systemapi 4465490a39dSopenharmony_ci * @since 12 4475490a39dSopenharmony_ci */ 4485490a39dSopenharmony_ci COMMON_SPOKEN_LANGUAGE = 10, 4495490a39dSopenharmony_ci /** 4505490a39dSopenharmony_ci * Contain sensitive word. 4515490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4525490a39dSopenharmony_ci * @systemapi 4535490a39dSopenharmony_ci * @since 12 4545490a39dSopenharmony_ci */ 4555490a39dSopenharmony_ci SENSITIVE_WORD = 11, 4565490a39dSopenharmony_ci /** 4575490a39dSopenharmony_ci * Two consecutive words without initial consonant. 4585490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4595490a39dSopenharmony_ci * @systemapi 4605490a39dSopenharmony_ci * @since 12 4615490a39dSopenharmony_ci */ 4625490a39dSopenharmony_ci NO_INITIAL_CONSONANT = 12, 4635490a39dSopenharmony_ci /** 4645490a39dSopenharmony_ci * Contain repeated phoneme. 4655490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4665490a39dSopenharmony_ci * @systemapi 4675490a39dSopenharmony_ci * @since 12 4685490a39dSopenharmony_ci */ 4695490a39dSopenharmony_ci REPEATED_PHONEME = 13, 4705490a39dSopenharmony_ci } 4715490a39dSopenharmony_ci 4725490a39dSopenharmony_ci /** 4735490a39dSopenharmony_ci * Describes evaluation result. 4745490a39dSopenharmony_ci * @typedef EvaluationResult 4755490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4765490a39dSopenharmony_ci * @systemapi 4775490a39dSopenharmony_ci * @since 12 4785490a39dSopenharmony_ci */ 4795490a39dSopenharmony_ci interface EvaluationResult { 4805490a39dSopenharmony_ci /** 4815490a39dSopenharmony_ci * Evaluation score. 4825490a39dSopenharmony_ci * @type { number } 4835490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4845490a39dSopenharmony_ci * @systemapi 4855490a39dSopenharmony_ci * @since 12 4865490a39dSopenharmony_ci */ 4875490a39dSopenharmony_ci score: number; 4885490a39dSopenharmony_ci /** 4895490a39dSopenharmony_ci * Describes evaluation result code. 4905490a39dSopenharmony_ci * @type { EvaluationResultCode } 4915490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 4925490a39dSopenharmony_ci * @systemapi 4935490a39dSopenharmony_ci * @since 12 4945490a39dSopenharmony_ci */ 4955490a39dSopenharmony_ci resultCode: EvaluationResultCode; 4965490a39dSopenharmony_ci } 4975490a39dSopenharmony_ci 4985490a39dSopenharmony_ci /** 4995490a39dSopenharmony_ci * Obtains an {@link WakeupManager} instance. 5005490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 5015490a39dSopenharmony_ci * @returns { WakeupManager } this {@link WakeupManager} object. 5025490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5035490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 5045490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 5055490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 5065490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5075490a39dSopenharmony_ci * @systemapi 5085490a39dSopenharmony_ci * @since 12 5095490a39dSopenharmony_ci */ 5105490a39dSopenharmony_ci function getWakeupManager(): WakeupManager; 5115490a39dSopenharmony_ci 5125490a39dSopenharmony_ci /** 5135490a39dSopenharmony_ci * Obtains an {@link EnrollIntelligentVoiceEngine} instance. This method uses an asynchronous callback to return the EnrollIntelligentVoiceEngine instance. 5145490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 5155490a39dSopenharmony_ci * @param { EnrollIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates enroll intelligent voice engine descriptor. 5165490a39dSopenharmony_ci * @param { AsyncCallback<EnrollIntelligentVoiceEngine> } callback - the callback used to return the EnrollIntelligentVoiceEngine instance. 5175490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5185490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 5195490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 5205490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 5215490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 5225490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5235490a39dSopenharmony_ci * @systemapi 5245490a39dSopenharmony_ci * @since 10 5255490a39dSopenharmony_ci */ 5265490a39dSopenharmony_ci function createEnrollIntelligentVoiceEngine(descriptor: EnrollIntelligentVoiceEngineDescriptor, callback: AsyncCallback<EnrollIntelligentVoiceEngine>): void; 5275490a39dSopenharmony_ci 5285490a39dSopenharmony_ci /** 5295490a39dSopenharmony_ci * Obtains an {@link EnrollIntelligentVoiceEngine} instance. This method uses a promise to return the EnrollIntelligentVoiceEngine instance. 5305490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 5315490a39dSopenharmony_ci * @param { EnrollIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates enroll intelligent voice engine descriptor. 5325490a39dSopenharmony_ci * @returns { Promise<EnrollIntelligentVoiceEngine> } the promise used to return the EnrollIntelligentVoiceEngine instance. 5335490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5345490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 5355490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 5365490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 5375490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 5385490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5395490a39dSopenharmony_ci * @systemapi 5405490a39dSopenharmony_ci * @since 10 5415490a39dSopenharmony_ci */ 5425490a39dSopenharmony_ci function createEnrollIntelligentVoiceEngine(descriptor: EnrollIntelligentVoiceEngineDescriptor): Promise<EnrollIntelligentVoiceEngine>; 5435490a39dSopenharmony_ci 5445490a39dSopenharmony_ci /** 5455490a39dSopenharmony_ci * Obtains an {@link WakeupIntelligentVoiceEngine} instance. This method uses an asynchronous callback to return the WakeupIntelligentVoiceEngine instance. 5465490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 5475490a39dSopenharmony_ci * @param { WakeupIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates wakeup intelligent voice engine descriptor. 5485490a39dSopenharmony_ci * @param { AsyncCallback<WakeupIntelligentVoiceEngine> } callback - the callback used to return the WakeupIntelligentVoiceEngine instance. 5495490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5505490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 5515490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 5525490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 5535490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 5545490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5555490a39dSopenharmony_ci * @systemapi 5565490a39dSopenharmony_ci * @since 10 5575490a39dSopenharmony_ci */ 5585490a39dSopenharmony_ci function createWakeupIntelligentVoiceEngine(descriptor: WakeupIntelligentVoiceEngineDescriptor, callback: AsyncCallback<WakeupIntelligentVoiceEngine>): void; 5595490a39dSopenharmony_ci 5605490a39dSopenharmony_ci /** 5615490a39dSopenharmony_ci * Obtains an {@link WakeupIntelligentVoiceEngine} instance. This method uses a promise to return the WakeupIntelligentVoiceEngine instance. 5625490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 5635490a39dSopenharmony_ci * @param { WakeupIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates wakeup intelligent voice engine descriptor. 5645490a39dSopenharmony_ci * @returns { Promise<WakeupIntelligentVoiceEngine> } the promise used to return the WakeupIntelligentVoiceEngine instance. 5655490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 5665490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 5675490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 5685490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 5695490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 5705490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5715490a39dSopenharmony_ci * @systemapi 5725490a39dSopenharmony_ci * @since 10 5735490a39dSopenharmony_ci */ 5745490a39dSopenharmony_ci function createWakeupIntelligentVoiceEngine(descriptor: WakeupIntelligentVoiceEngineDescriptor): Promise<WakeupIntelligentVoiceEngine>; 5755490a39dSopenharmony_ci 5765490a39dSopenharmony_ci /** 5775490a39dSopenharmony_ci * Describes enroll engine config. 5785490a39dSopenharmony_ci * @typedef EnrollEngineConfig 5795490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5805490a39dSopenharmony_ci * @systemapi 5815490a39dSopenharmony_ci * @since 10 5825490a39dSopenharmony_ci */ 5835490a39dSopenharmony_ci interface EnrollEngineConfig { 5845490a39dSopenharmony_ci /** 5855490a39dSopenharmony_ci * Language that enroll engine supports. 5865490a39dSopenharmony_ci * @type { string } 5875490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5885490a39dSopenharmony_ci * @systemapi 5895490a39dSopenharmony_ci * @since 10 5905490a39dSopenharmony_ci */ 5915490a39dSopenharmony_ci language: string; 5925490a39dSopenharmony_ci /** 5935490a39dSopenharmony_ci * Region that enroll engine supports. 5945490a39dSopenharmony_ci * @type { string } 5955490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 5965490a39dSopenharmony_ci * @systemapi 5975490a39dSopenharmony_ci * @since 10 5985490a39dSopenharmony_ci */ 5995490a39dSopenharmony_ci region: string; 6005490a39dSopenharmony_ci } 6015490a39dSopenharmony_ci 6025490a39dSopenharmony_ci /** 6035490a39dSopenharmony_ci * Enumerates sensibility type. 6045490a39dSopenharmony_ci * @enum {number} 6055490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6065490a39dSopenharmony_ci * @systemapi 6075490a39dSopenharmony_ci * @since 10 6085490a39dSopenharmony_ci */ 6095490a39dSopenharmony_ci enum SensibilityType { 6105490a39dSopenharmony_ci /** 6115490a39dSopenharmony_ci * Low sensibility. 6125490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6135490a39dSopenharmony_ci * @systemapi 6145490a39dSopenharmony_ci * @since 10 6155490a39dSopenharmony_ci */ 6165490a39dSopenharmony_ci LOW_SENSIBILITY = 1, 6175490a39dSopenharmony_ci /** 6185490a39dSopenharmony_ci * Middle sensibility. 6195490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6205490a39dSopenharmony_ci * @systemapi 6215490a39dSopenharmony_ci * @since 10 6225490a39dSopenharmony_ci */ 6235490a39dSopenharmony_ci MIDDLE_SENSIBILITY = 2, 6245490a39dSopenharmony_ci /** 6255490a39dSopenharmony_ci * High sensibility. 6265490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6275490a39dSopenharmony_ci * @systemapi 6285490a39dSopenharmony_ci * @since 10 6295490a39dSopenharmony_ci */ 6305490a39dSopenharmony_ci HIGH_SENSIBILITY = 3, 6315490a39dSopenharmony_ci } 6325490a39dSopenharmony_ci 6335490a39dSopenharmony_ci /** 6345490a39dSopenharmony_ci * Describes wakeup hap information. 6355490a39dSopenharmony_ci * @typedef WakeupHapInfo 6365490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6375490a39dSopenharmony_ci * @systemapi 6385490a39dSopenharmony_ci * @since 10 6395490a39dSopenharmony_ci */ 6405490a39dSopenharmony_ci interface WakeupHapInfo { 6415490a39dSopenharmony_ci /** 6425490a39dSopenharmony_ci * Bundle name. 6435490a39dSopenharmony_ci * @type { string } 6445490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6455490a39dSopenharmony_ci * @systemapi 6465490a39dSopenharmony_ci * @since 10 6475490a39dSopenharmony_ci */ 6485490a39dSopenharmony_ci bundleName: string; 6495490a39dSopenharmony_ci /** 6505490a39dSopenharmony_ci * Ability name. 6515490a39dSopenharmony_ci * @type { string } 6525490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6535490a39dSopenharmony_ci * @systemapi 6545490a39dSopenharmony_ci * @since 10 6555490a39dSopenharmony_ci */ 6565490a39dSopenharmony_ci abilityName: string; 6575490a39dSopenharmony_ci } 6585490a39dSopenharmony_ci 6595490a39dSopenharmony_ci /** 6605490a39dSopenharmony_ci * Enumerates wakeup intelligent voice event type. 6615490a39dSopenharmony_ci * @enum {number} 6625490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6635490a39dSopenharmony_ci * @systemapi 6645490a39dSopenharmony_ci * @since 10 6655490a39dSopenharmony_ci */ 6665490a39dSopenharmony_ci enum WakeupIntelligentVoiceEventType { 6675490a39dSopenharmony_ci /** 6685490a39dSopenharmony_ci * Wakeup None. 6695490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6705490a39dSopenharmony_ci * @systemapi 6715490a39dSopenharmony_ci * @since 10 6725490a39dSopenharmony_ci */ 6735490a39dSopenharmony_ci INTELLIGENT_VOICE_EVENT_WAKEUP_NONE = 0, 6745490a39dSopenharmony_ci /** 6755490a39dSopenharmony_ci * Recognize complete. 6765490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6775490a39dSopenharmony_ci * @systemapi 6785490a39dSopenharmony_ci * @since 10 6795490a39dSopenharmony_ci */ 6805490a39dSopenharmony_ci INTELLIGENT_VOICE_EVENT_RECOGNIZE_COMPLETE = 1, 6815490a39dSopenharmony_ci /** 6825490a39dSopenharmony_ci * Headset Recognize complete. 6835490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6845490a39dSopenharmony_ci * @systemapi 6855490a39dSopenharmony_ci * @since 12 6865490a39dSopenharmony_ci */ 6875490a39dSopenharmony_ci INTELLIGENT_VOICE_EVENT_HEADSET_RECOGNIZE_COMPLETE = 2, 6885490a39dSopenharmony_ci } 6895490a39dSopenharmony_ci 6905490a39dSopenharmony_ci /** 6915490a39dSopenharmony_ci * Enumerates intelligent voice error code. 6925490a39dSopenharmony_ci * @enum {number} 6935490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 6945490a39dSopenharmony_ci * @systemapi 6955490a39dSopenharmony_ci * @since 10 6965490a39dSopenharmony_ci */ 6975490a39dSopenharmony_ci enum IntelligentVoiceErrorCode { 6985490a39dSopenharmony_ci /** 6995490a39dSopenharmony_ci * No memory. 7005490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7015490a39dSopenharmony_ci * @systemapi 7025490a39dSopenharmony_ci * @since 10 7035490a39dSopenharmony_ci */ 7045490a39dSopenharmony_ci INTELLIGENT_VOICE_NO_MEMORY = 22700101, 7055490a39dSopenharmony_ci /** 7065490a39dSopenharmony_ci * Invalid parameter. 7075490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7085490a39dSopenharmony_ci * @systemapi 7095490a39dSopenharmony_ci * @since 10 7105490a39dSopenharmony_ci */ 7115490a39dSopenharmony_ci INTELLIGENT_VOICE_INVALID_PARAM = 22700102, 7125490a39dSopenharmony_ci /** 7135490a39dSopenharmony_ci * Init failed. 7145490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7155490a39dSopenharmony_ci * @systemapi 7165490a39dSopenharmony_ci * @since 10 7175490a39dSopenharmony_ci */ 7185490a39dSopenharmony_ci INTELLIGENT_VOICE_INIT_FAILED = 22700103, 7195490a39dSopenharmony_ci /** 7205490a39dSopenharmony_ci * Failed to commit the enrollment. 7215490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7225490a39dSopenharmony_ci * @systemapi 7235490a39dSopenharmony_ci * @since 10 7245490a39dSopenharmony_ci */ 7255490a39dSopenharmony_ci INTELLIGENT_VOICE_COMMIT_ENROLL_FAILED = 22700104, 7265490a39dSopenharmony_ci /** 7275490a39dSopenharmony_ci * Start capturer failed. 7285490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7295490a39dSopenharmony_ci * @systemapi 7305490a39dSopenharmony_ci * @since 12 7315490a39dSopenharmony_ci */ 7325490a39dSopenharmony_ci INTELLIGENT_VOICE_START_CAPTURER_FAILED = 22700105, 7335490a39dSopenharmony_ci /** 7345490a39dSopenharmony_ci * Read failed. 7355490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7365490a39dSopenharmony_ci * @systemapi 7375490a39dSopenharmony_ci * @since 12 7385490a39dSopenharmony_ci */ 7395490a39dSopenharmony_ci INTELLIGENT_VOICE_READ_FAILED = 22700106, 7405490a39dSopenharmony_ci /** 7415490a39dSopenharmony_ci * System error. 7425490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7435490a39dSopenharmony_ci * @systemapi 7445490a39dSopenharmony_ci * @since 12 7455490a39dSopenharmony_ci */ 7465490a39dSopenharmony_ci INTELLIGENT_VOICE_SYSTEM_ERROR = 22700107, 7475490a39dSopenharmony_ci } 7485490a39dSopenharmony_ci 7495490a39dSopenharmony_ci /** 7505490a39dSopenharmony_ci * Enumerates enroll result. 7515490a39dSopenharmony_ci * @enum {number} 7525490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7535490a39dSopenharmony_ci * @systemapi 7545490a39dSopenharmony_ci * @since 10 7555490a39dSopenharmony_ci */ 7565490a39dSopenharmony_ci enum EnrollResult { 7575490a39dSopenharmony_ci /** 7585490a39dSopenharmony_ci * Success. 7595490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7605490a39dSopenharmony_ci * @systemapi 7615490a39dSopenharmony_ci * @since 10 7625490a39dSopenharmony_ci */ 7635490a39dSopenharmony_ci SUCCESS = 0, 7645490a39dSopenharmony_ci /** 7655490a39dSopenharmony_ci * Vpr train failed. 7665490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7675490a39dSopenharmony_ci * @systemapi 7685490a39dSopenharmony_ci * @since 10 7695490a39dSopenharmony_ci */ 7705490a39dSopenharmony_ci VPR_TRAIN_FAILED = -1, 7715490a39dSopenharmony_ci /** 7725490a39dSopenharmony_ci * Wakeup phrase not match. 7735490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7745490a39dSopenharmony_ci * @systemapi 7755490a39dSopenharmony_ci * @since 10 7765490a39dSopenharmony_ci */ 7775490a39dSopenharmony_ci WAKEUP_PHRASE_NOT_MATCH = -2, 7785490a39dSopenharmony_ci /** 7795490a39dSopenharmony_ci * Too noisy. 7805490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7815490a39dSopenharmony_ci * @systemapi 7825490a39dSopenharmony_ci * @since 10 7835490a39dSopenharmony_ci */ 7845490a39dSopenharmony_ci TOO_NOISY = -3, 7855490a39dSopenharmony_ci /** 7865490a39dSopenharmony_ci * Too loud. 7875490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7885490a39dSopenharmony_ci * @systemapi 7895490a39dSopenharmony_ci * @since 10 7905490a39dSopenharmony_ci */ 7915490a39dSopenharmony_ci TOO_LOUD = -4, 7925490a39dSopenharmony_ci /** 7935490a39dSopenharmony_ci * Interval large. 7945490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 7955490a39dSopenharmony_ci * @systemapi 7965490a39dSopenharmony_ci * @since 10 7975490a39dSopenharmony_ci */ 7985490a39dSopenharmony_ci INTERVAL_LARGE = -5, 7995490a39dSopenharmony_ci /** 8005490a39dSopenharmony_ci * Different person. 8015490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8025490a39dSopenharmony_ci * @systemapi 8035490a39dSopenharmony_ci * @since 10 8045490a39dSopenharmony_ci */ 8055490a39dSopenharmony_ci DIFFERENT_PERSON = -6, 8065490a39dSopenharmony_ci /** 8075490a39dSopenharmony_ci * Unknown error. 8085490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8095490a39dSopenharmony_ci * @systemapi 8105490a39dSopenharmony_ci * @since 10 8115490a39dSopenharmony_ci */ 8125490a39dSopenharmony_ci UNKNOWN_ERROR = -100, 8135490a39dSopenharmony_ci } 8145490a39dSopenharmony_ci 8155490a39dSopenharmony_ci /** 8165490a39dSopenharmony_ci * Enumerates capturer channel. 8175490a39dSopenharmony_ci * @enum {number} 8185490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8195490a39dSopenharmony_ci * @systemapi 8205490a39dSopenharmony_ci * @since 12 8215490a39dSopenharmony_ci */ 8225490a39dSopenharmony_ci enum CapturerChannel { 8235490a39dSopenharmony_ci /** 8245490a39dSopenharmony_ci * Capturer channel 1. 8255490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8265490a39dSopenharmony_ci * @systemapi 8275490a39dSopenharmony_ci * @since 12 8285490a39dSopenharmony_ci */ 8295490a39dSopenharmony_ci CAPTURER_CHANNEL_1 = 0x1 << 0, 8305490a39dSopenharmony_ci /** 8315490a39dSopenharmony_ci * Capturer channel 2. 8325490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8335490a39dSopenharmony_ci * @systemapi 8345490a39dSopenharmony_ci * @since 12 8355490a39dSopenharmony_ci */ 8365490a39dSopenharmony_ci CAPTURER_CHANNEL_2 = 0x1 << 1, 8375490a39dSopenharmony_ci /** 8385490a39dSopenharmony_ci * Capturer channel 3. 8395490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8405490a39dSopenharmony_ci * @systemapi 8415490a39dSopenharmony_ci * @since 12 8425490a39dSopenharmony_ci */ 8435490a39dSopenharmony_ci CAPTURER_CHANNEL_3 = 0x1 << 2, 8445490a39dSopenharmony_ci /** 8455490a39dSopenharmony_ci * Capturer channel 4. 8465490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8475490a39dSopenharmony_ci * @systemapi 8485490a39dSopenharmony_ci * @since 12 8495490a39dSopenharmony_ci */ 8505490a39dSopenharmony_ci CAPTURER_CHANNEL_4 = 0x1 << 3, 8515490a39dSopenharmony_ci } 8525490a39dSopenharmony_ci 8535490a39dSopenharmony_ci /** 8545490a39dSopenharmony_ci * Describes enroll callback information. 8555490a39dSopenharmony_ci * @typedef EnrollCallbackInfo 8565490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8575490a39dSopenharmony_ci * @systemapi 8585490a39dSopenharmony_ci * @since 10 8595490a39dSopenharmony_ci */ 8605490a39dSopenharmony_ci interface EnrollCallbackInfo { 8615490a39dSopenharmony_ci /** 8625490a39dSopenharmony_ci * Result. 8635490a39dSopenharmony_ci * @type { EnrollResult } 8645490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8655490a39dSopenharmony_ci * @systemapi 8665490a39dSopenharmony_ci * @since 10 8675490a39dSopenharmony_ci */ 8685490a39dSopenharmony_ci result: EnrollResult; 8695490a39dSopenharmony_ci /** 8705490a39dSopenharmony_ci * Describes enroll event context. 8715490a39dSopenharmony_ci * @type { string } 8725490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8735490a39dSopenharmony_ci * @systemapi 8745490a39dSopenharmony_ci * @since 10 8755490a39dSopenharmony_ci */ 8765490a39dSopenharmony_ci context: string; 8775490a39dSopenharmony_ci } 8785490a39dSopenharmony_ci 8795490a39dSopenharmony_ci /** 8805490a39dSopenharmony_ci * Describes wakeup intelligent voice engine callback information. 8815490a39dSopenharmony_ci * @typedef WakeupIntelligentVoiceEngineCallbackInfo 8825490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8835490a39dSopenharmony_ci * @systemapi 8845490a39dSopenharmony_ci * @since 10 8855490a39dSopenharmony_ci */ 8865490a39dSopenharmony_ci interface WakeupIntelligentVoiceEngineCallbackInfo { 8875490a39dSopenharmony_ci /** 8885490a39dSopenharmony_ci * Wakeup event id. 8895490a39dSopenharmony_ci * @type { WakeupIntelligentVoiceEventType } 8905490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8915490a39dSopenharmony_ci * @systemapi 8925490a39dSopenharmony_ci * @since 10 8935490a39dSopenharmony_ci */ 8945490a39dSopenharmony_ci eventId: WakeupIntelligentVoiceEventType; 8955490a39dSopenharmony_ci /** 8965490a39dSopenharmony_ci * Is success. 8975490a39dSopenharmony_ci * @type { boolean } 8985490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 8995490a39dSopenharmony_ci * @systemapi 9005490a39dSopenharmony_ci * @since 10 9015490a39dSopenharmony_ci */ 9025490a39dSopenharmony_ci isSuccess: boolean; 9035490a39dSopenharmony_ci /** 9045490a39dSopenharmony_ci * Describes wakeup event context. 9055490a39dSopenharmony_ci * @type { string } 9065490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9075490a39dSopenharmony_ci * @systemapi 9085490a39dSopenharmony_ci * @since 10 9095490a39dSopenharmony_ci */ 9105490a39dSopenharmony_ci context: string; 9115490a39dSopenharmony_ci } 9125490a39dSopenharmony_ci 9135490a39dSopenharmony_ci /** 9145490a39dSopenharmony_ci * Implements enroll intelligent voice engine. 9155490a39dSopenharmony_ci * @typedef EnrollIntelligentVoiceEngine 9165490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9175490a39dSopenharmony_ci * @systemapi 9185490a39dSopenharmony_ci * @since 10 9195490a39dSopenharmony_ci */ 9205490a39dSopenharmony_ci interface EnrollIntelligentVoiceEngine { 9215490a39dSopenharmony_ci /** 9225490a39dSopenharmony_ci * Obtains the supported regions, This method uses an asynchronous callback to return the query result. 9235490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 9245490a39dSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - the callback used to return the supported regions. 9255490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9265490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 9275490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9285490a39dSopenharmony_ci * @systemapi 9295490a39dSopenharmony_ci * @since 10 9305490a39dSopenharmony_ci */ 9315490a39dSopenharmony_ci getSupportedRegions(callback: AsyncCallback<Array<string>>): void; 9325490a39dSopenharmony_ci /** 9335490a39dSopenharmony_ci * Obtains the supported regions, This method uses a promise to return the query result. 9345490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 9355490a39dSopenharmony_ci * @returns { Promise<Array<string>> } the promise used to return the supported regions. 9365490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9375490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 9385490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9395490a39dSopenharmony_ci * @systemapi 9405490a39dSopenharmony_ci * @since 10 9415490a39dSopenharmony_ci */ 9425490a39dSopenharmony_ci getSupportedRegions(): Promise<Array<string>>; 9435490a39dSopenharmony_ci /** 9445490a39dSopenharmony_ci * Initials the engine, This method uses an asynchronous callback to return the result. 9455490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 9465490a39dSopenharmony_ci * @param { EnrollEngineConfig } config - config indicates enroll engine configuration. 9475490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 9485490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9495490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 9505490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 9515490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 9525490a39dSopenharmony_ci * @throws { BusinessError } 22700103 - Init failed. 9535490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9545490a39dSopenharmony_ci * @systemapi 9555490a39dSopenharmony_ci * @since 10 9565490a39dSopenharmony_ci */ 9575490a39dSopenharmony_ci init(config: EnrollEngineConfig, callback: AsyncCallback<void>): void; 9585490a39dSopenharmony_ci /** 9595490a39dSopenharmony_ci * Initials the engine, This method uses a promise to return the result. 9605490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 9615490a39dSopenharmony_ci * @param { EnrollEngineConfig } config - config indicates enroll engine configuration. 9625490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 9635490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9645490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 9655490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 9665490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 9675490a39dSopenharmony_ci * @throws { BusinessError } 22700103 - Init failed. 9685490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9695490a39dSopenharmony_ci * @systemapi 9705490a39dSopenharmony_ci * @since 10 9715490a39dSopenharmony_ci */ 9725490a39dSopenharmony_ci init(config: EnrollEngineConfig): Promise<void>; 9735490a39dSopenharmony_ci /** 9745490a39dSopenharmony_ci * Enrolls for result, This method uses an asynchronous callback to return the result. 9755490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 9765490a39dSopenharmony_ci * @param { boolean } isLast - isLast indicates if it is the last time to enroll. 9775490a39dSopenharmony_ci * @param { AsyncCallback<EnrollCallbackInfo> } callback - the callback used to return the result. 9785490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9795490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 9805490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 9815490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9825490a39dSopenharmony_ci * @systemapi 9835490a39dSopenharmony_ci * @since 10 9845490a39dSopenharmony_ci */ 9855490a39dSopenharmony_ci enrollForResult(isLast: boolean, callback: AsyncCallback<EnrollCallbackInfo>): void; 9865490a39dSopenharmony_ci /** 9875490a39dSopenharmony_ci * Enrolls for result, This method uses a promise to return the result. 9885490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 9895490a39dSopenharmony_ci * @param { boolean } isLast - isLast indicates if it is the last time to enroll. 9905490a39dSopenharmony_ci * @returns { Promise<EnrollCallbackInfo> } the promise used to return the result. 9915490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 9925490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 9935490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 9945490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 9955490a39dSopenharmony_ci * @systemapi 9965490a39dSopenharmony_ci * @since 10 9975490a39dSopenharmony_ci */ 9985490a39dSopenharmony_ci enrollForResult(isLast: boolean): Promise<EnrollCallbackInfo>; 9995490a39dSopenharmony_ci /** 10005490a39dSopenharmony_ci * Stops the engine, This method uses an asynchronous callback to return the result. 10015490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10025490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 10035490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10045490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10055490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10065490a39dSopenharmony_ci * @systemapi 10075490a39dSopenharmony_ci * @since 10 10085490a39dSopenharmony_ci */ 10095490a39dSopenharmony_ci stop(callback: AsyncCallback<void>): void; 10105490a39dSopenharmony_ci /** 10115490a39dSopenharmony_ci * Stops the engine, This method uses a promise to return the result. 10125490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10135490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 10145490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10155490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10165490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10175490a39dSopenharmony_ci * @systemapi 10185490a39dSopenharmony_ci * @since 10 10195490a39dSopenharmony_ci */ 10205490a39dSopenharmony_ci stop(): Promise<void>; 10215490a39dSopenharmony_ci /** 10225490a39dSopenharmony_ci * Commit enroll, This method uses an asynchronous callback to return the result. 10235490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10245490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 10255490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10265490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10275490a39dSopenharmony_ci * @throws { BusinessError } 22700104 - Failed to commit the enrollment. 10285490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10295490a39dSopenharmony_ci * @systemapi 10305490a39dSopenharmony_ci * @since 10 10315490a39dSopenharmony_ci */ 10325490a39dSopenharmony_ci commit(callback: AsyncCallback<void>): void; 10335490a39dSopenharmony_ci /** 10345490a39dSopenharmony_ci * Commit enroll, This method uses a promise to return the result. 10355490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10365490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 10375490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10385490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10395490a39dSopenharmony_ci * @throws { BusinessError } 22700104 - Failed to commit the enrollment. 10405490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10415490a39dSopenharmony_ci * @systemapi 10425490a39dSopenharmony_ci * @since 10 10435490a39dSopenharmony_ci */ 10445490a39dSopenharmony_ci commit(): Promise<void>; 10455490a39dSopenharmony_ci /** 10465490a39dSopenharmony_ci * Sets wakeup hap information, This method uses an asynchronous callback to return the result. 10475490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10485490a39dSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 10495490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 10505490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10515490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10525490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 10535490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 10545490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10555490a39dSopenharmony_ci * @systemapi 10565490a39dSopenharmony_ci * @since 10 10575490a39dSopenharmony_ci */ 10585490a39dSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo, callback: AsyncCallback<void>): void; 10595490a39dSopenharmony_ci /** 10605490a39dSopenharmony_ci * Sets wakeup hap information, This method uses a promise to return the result. 10615490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10625490a39dSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 10635490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 10645490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10655490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10665490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 10675490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 10685490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10695490a39dSopenharmony_ci * @systemapi 10705490a39dSopenharmony_ci * @since 10 10715490a39dSopenharmony_ci */ 10725490a39dSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo): Promise<void>; 10735490a39dSopenharmony_ci /** 10745490a39dSopenharmony_ci * Sets sensibility, This method uses an asynchronous callback to return the result. 10755490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10765490a39dSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 10775490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 10785490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10795490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10805490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 10815490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 10825490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10835490a39dSopenharmony_ci * @systemapi 10845490a39dSopenharmony_ci * @since 10 10855490a39dSopenharmony_ci */ 10865490a39dSopenharmony_ci setSensibility(sensibility: SensibilityType, callback: AsyncCallback<void>): void; 10875490a39dSopenharmony_ci /** 10885490a39dSopenharmony_ci * Sets sensibility, This method uses a promise to return the result. 10895490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 10905490a39dSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 10915490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 10925490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 10935490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 10945490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 10955490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 10965490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 10975490a39dSopenharmony_ci * @systemapi 10985490a39dSopenharmony_ci * @since 10 10995490a39dSopenharmony_ci */ 11005490a39dSopenharmony_ci setSensibility(sensibility: SensibilityType): Promise<void>; 11015490a39dSopenharmony_ci /** 11025490a39dSopenharmony_ci * Sets an intelligent voice parameter. This method uses an asynchronous callback to return the result. 11035490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11045490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 11055490a39dSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 11065490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 11075490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11085490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11095490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 11105490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 11115490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11125490a39dSopenharmony_ci * @systemapi 11135490a39dSopenharmony_ci * @since 10 11145490a39dSopenharmony_ci */ 11155490a39dSopenharmony_ci setParameter(key: string, value: string, callback: AsyncCallback<void>): void; 11165490a39dSopenharmony_ci /** 11175490a39dSopenharmony_ci * Sets an intelligent voice parameter. This method uses a promise to return the result. 11185490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11195490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 11205490a39dSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 11215490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 11225490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11235490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11245490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 11255490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 11265490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11275490a39dSopenharmony_ci * @systemapi 11285490a39dSopenharmony_ci * @since 10 11295490a39dSopenharmony_ci */ 11305490a39dSopenharmony_ci setParameter(key: string, value: string): Promise<void>; 11315490a39dSopenharmony_ci /** 11325490a39dSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses an asynchronous callback to return the query result. 11335490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11345490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 11355490a39dSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback used to return the value of the intelligent voice parameter. 11365490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11375490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11385490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 11395490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 11405490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11415490a39dSopenharmony_ci * @systemapi 11425490a39dSopenharmony_ci * @since 10 11435490a39dSopenharmony_ci */ 11445490a39dSopenharmony_ci getParameter(key: string, callback: AsyncCallback<string>): void; 11455490a39dSopenharmony_ci /** 11465490a39dSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result. 11475490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11485490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 11495490a39dSopenharmony_ci * @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter. 11505490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11515490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11525490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 11535490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 11545490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11555490a39dSopenharmony_ci * @systemapi 11565490a39dSopenharmony_ci * @since 10 11575490a39dSopenharmony_ci */ 11585490a39dSopenharmony_ci getParameter(key: string): Promise<string>; 11595490a39dSopenharmony_ci /** 11605490a39dSopenharmony_ci * Evaluates for result, This method uses a promise to return the result. 11615490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11625490a39dSopenharmony_ci * @param { string } word - the word to evaluate. 11635490a39dSopenharmony_ci * @returns { Promise<EvaluationResult> } the promise used to return the result. 11645490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11655490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11665490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 11675490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 11685490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11695490a39dSopenharmony_ci * @systemapi 11705490a39dSopenharmony_ci * @since 12 11715490a39dSopenharmony_ci */ 11725490a39dSopenharmony_ci evaluateForResult(word: string): Promise<EvaluationResult>; 11735490a39dSopenharmony_ci /** 11745490a39dSopenharmony_ci * Releases the engine, This method uses an asynchronous callback to return the result. 11755490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11765490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 11775490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11785490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11795490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11805490a39dSopenharmony_ci * @systemapi 11815490a39dSopenharmony_ci * @since 10 11825490a39dSopenharmony_ci */ 11835490a39dSopenharmony_ci release(callback: AsyncCallback<void>): void; 11845490a39dSopenharmony_ci /** 11855490a39dSopenharmony_ci * Releases the engine, This method uses a promise to return the result. 11865490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 11875490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 11885490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 11895490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 11905490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 11915490a39dSopenharmony_ci * @systemapi 11925490a39dSopenharmony_ci * @since 10 11935490a39dSopenharmony_ci */ 11945490a39dSopenharmony_ci release(): Promise<void>; 11955490a39dSopenharmony_ci } 11965490a39dSopenharmony_ci 11975490a39dSopenharmony_ci /** 11985490a39dSopenharmony_ci * Implements wakeup intelligent voice engine. 11995490a39dSopenharmony_ci * @typedef WakeupIntelligentVoiceEngine 12005490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12015490a39dSopenharmony_ci * @systemapi 12025490a39dSopenharmony_ci * @since 10 12035490a39dSopenharmony_ci */ 12045490a39dSopenharmony_ci interface WakeupIntelligentVoiceEngine { 12055490a39dSopenharmony_ci /** 12065490a39dSopenharmony_ci * Obtains the supported regions, This method uses an asynchronous callback to return the query result. 12075490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12085490a39dSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - the callback used to return the supported regions. 12095490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12105490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12115490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12125490a39dSopenharmony_ci * @systemapi 12135490a39dSopenharmony_ci * @since 10 12145490a39dSopenharmony_ci */ 12155490a39dSopenharmony_ci getSupportedRegions(callback: AsyncCallback<Array<string>>): void; 12165490a39dSopenharmony_ci /** 12175490a39dSopenharmony_ci * Obtains the supported regions, This method uses a promise to return the query result. 12185490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12195490a39dSopenharmony_ci * @returns { Promise<Array<string>> } the promise used to return the supported regions. 12205490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12215490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12225490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12235490a39dSopenharmony_ci * @systemapi 12245490a39dSopenharmony_ci * @since 10 12255490a39dSopenharmony_ci */ 12265490a39dSopenharmony_ci getSupportedRegions(): Promise<Array<string>>; 12275490a39dSopenharmony_ci /** 12285490a39dSopenharmony_ci * Sets wakeup hap information, This method uses an asynchronous callback to return the result. 12295490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12305490a39dSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 12315490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 12325490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12335490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12345490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 12355490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 12365490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12375490a39dSopenharmony_ci * @systemapi 12385490a39dSopenharmony_ci * @since 10 12395490a39dSopenharmony_ci */ 12405490a39dSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo, callback: AsyncCallback<void>): void; 12415490a39dSopenharmony_ci /** 12425490a39dSopenharmony_ci * Sets wakeup hap information, This method uses a promise to return the result. 12435490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12445490a39dSopenharmony_ci * @param { WakeupHapInfo } info - info indicates wakeup hap information. 12455490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 12465490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12475490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12485490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 12495490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 12505490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12515490a39dSopenharmony_ci * @systemapi 12525490a39dSopenharmony_ci * @since 10 12535490a39dSopenharmony_ci */ 12545490a39dSopenharmony_ci setWakeupHapInfo(info: WakeupHapInfo): Promise<void>; 12555490a39dSopenharmony_ci /** 12565490a39dSopenharmony_ci * Sets sensibility, This method uses an asynchronous callback to return the result. 12575490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12585490a39dSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 12595490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 12605490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12615490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12625490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 12635490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 12645490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12655490a39dSopenharmony_ci * @systemapi 12665490a39dSopenharmony_ci * @since 10 12675490a39dSopenharmony_ci */ 12685490a39dSopenharmony_ci setSensibility(sensibility: SensibilityType, callback: AsyncCallback<void>): void; 12695490a39dSopenharmony_ci /** 12705490a39dSopenharmony_ci * Sets sensibility, This method uses a promise to return the result. 12715490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12725490a39dSopenharmony_ci * @param { SensibilityType } sensibility - sensibility to set. 12735490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 12745490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12755490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12765490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 12775490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 12785490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12795490a39dSopenharmony_ci * @systemapi 12805490a39dSopenharmony_ci * @since 10 12815490a39dSopenharmony_ci */ 12825490a39dSopenharmony_ci setSensibility(sensibility: SensibilityType): Promise<void>; 12835490a39dSopenharmony_ci /** 12845490a39dSopenharmony_ci * Sets an intelligent voice parameter. This method uses an asynchronous callback to return the result. 12855490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 12865490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 12875490a39dSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 12885490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 12895490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 12905490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 12915490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 12925490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 12935490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 12945490a39dSopenharmony_ci * @systemapi 12955490a39dSopenharmony_ci * @since 10 12965490a39dSopenharmony_ci */ 12975490a39dSopenharmony_ci setParameter(key: string, value: string, callback: AsyncCallback<void>): void; 12985490a39dSopenharmony_ci /** 12995490a39dSopenharmony_ci * Sets an intelligent voice parameter. This method uses a promise to return the result. 13005490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13015490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter to set. 13025490a39dSopenharmony_ci * @param { string } value - the value of the intelligent voice parameter to set. 13035490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 13045490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13055490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13065490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 13075490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 13085490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13095490a39dSopenharmony_ci * @systemapi 13105490a39dSopenharmony_ci * @since 10 13115490a39dSopenharmony_ci */ 13125490a39dSopenharmony_ci setParameter(key: string, value: string): Promise<void>; 13135490a39dSopenharmony_ci /** 13145490a39dSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses an asynchronous callback to return the query result. 13155490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13165490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 13175490a39dSopenharmony_ci * @param { AsyncCallback<string> } callback - the callback used to return the value of the intelligent voice parameter. 13185490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13195490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13205490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 13215490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 13225490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13235490a39dSopenharmony_ci * @systemapi 13245490a39dSopenharmony_ci * @since 10 13255490a39dSopenharmony_ci */ 13265490a39dSopenharmony_ci getParameter(key: string, callback: AsyncCallback<string>): void; 13275490a39dSopenharmony_ci /** 13285490a39dSopenharmony_ci * Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result. 13295490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13305490a39dSopenharmony_ci * @param { string } key - the key of the intelligent voice parameter whose value is to be obtained. 13315490a39dSopenharmony_ci * @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter. 13325490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13335490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13345490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 13355490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 13365490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13375490a39dSopenharmony_ci * @systemapi 13385490a39dSopenharmony_ci * @since 10 13395490a39dSopenharmony_ci */ 13405490a39dSopenharmony_ci getParameter(key: string): Promise<string>; 13415490a39dSopenharmony_ci /** 13425490a39dSopenharmony_ci * Gets pulse-code modulation audio. This method uses a promise to return the result. 13435490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13445490a39dSopenharmony_ci * @returns { Promise<ArrayBuffer> } the promise used to return the pulse-code modulation audio. 13455490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13465490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13475490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 13485490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 13495490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13505490a39dSopenharmony_ci * @systemapi 13515490a39dSopenharmony_ci * @since 12 13525490a39dSopenharmony_ci */ 13535490a39dSopenharmony_ci getPcm(): Promise<ArrayBuffer>; 13545490a39dSopenharmony_ci /** 13555490a39dSopenharmony_ci * Starts the capturer. This method uses a promise to return the result. 13565490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13575490a39dSopenharmony_ci * @param { number } channels - the channels needed in reading. The channels should be greater than 0 and smaller than 16. 13585490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 13595490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13605490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13615490a39dSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3.Parameter verification failed. 13625490a39dSopenharmony_ci * @throws { BusinessError } 22700102 - Invalid parameter. 13635490a39dSopenharmony_ci * @throws { BusinessError } 22700105 - Start capturer failed. 13645490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 13655490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13665490a39dSopenharmony_ci * @systemapi 13675490a39dSopenharmony_ci * @since 12 13685490a39dSopenharmony_ci */ 13695490a39dSopenharmony_ci startCapturer(channels: number): Promise<void>; 13705490a39dSopenharmony_ci /** 13715490a39dSopenharmony_ci * Reads the buffer from wakeup engine. This method uses a promise to return the result. 13725490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13735490a39dSopenharmony_ci * @returns { Promise<ArrayBuffer> } the promise used to return the buffer. 13745490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13755490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13765490a39dSopenharmony_ci * @throws { BusinessError } 22700101 - No memory. 13775490a39dSopenharmony_ci * @throws { BusinessError } 22700106 - Read failed. 13785490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 13795490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13805490a39dSopenharmony_ci * @systemapi 13815490a39dSopenharmony_ci * @since 12 13825490a39dSopenharmony_ci */ 13835490a39dSopenharmony_ci read(): Promise<ArrayBuffer>; 13845490a39dSopenharmony_ci /** 13855490a39dSopenharmony_ci * Stops the capturer. This method uses a promise to return the result. 13865490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13875490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 13885490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 13895490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 13905490a39dSopenharmony_ci * @throws { BusinessError } 22700107 - System error. 13915490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 13925490a39dSopenharmony_ci * @systemapi 13935490a39dSopenharmony_ci * @since 12 13945490a39dSopenharmony_ci */ 13955490a39dSopenharmony_ci stopCapturer(): Promise<void>; 13965490a39dSopenharmony_ci /** 13975490a39dSopenharmony_ci * Releases the engine, This method uses an asynchronous callback to return the result. 13985490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 13995490a39dSopenharmony_ci * @param { AsyncCallback<void> } callback - the callback used to return the result. 14005490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 14015490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 14025490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 14035490a39dSopenharmony_ci * @systemapi 14045490a39dSopenharmony_ci * @since 10 14055490a39dSopenharmony_ci */ 14065490a39dSopenharmony_ci release(callback: AsyncCallback<void>): void; 14075490a39dSopenharmony_ci /** 14085490a39dSopenharmony_ci * Releases the engine, This method uses a promise to return the result. 14095490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 14105490a39dSopenharmony_ci * @returns { Promise<void> } the promise used to return the result. 14115490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 14125490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 14135490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 14145490a39dSopenharmony_ci * @systemapi 14155490a39dSopenharmony_ci * @since 10 14165490a39dSopenharmony_ci */ 14175490a39dSopenharmony_ci release(): Promise<void>; 14185490a39dSopenharmony_ci /** 14195490a39dSopenharmony_ci * Subscribes wakeup intelligent voice events. When wakeup intelligent voice events reach, 14205490a39dSopenharmony_ci * the callback is invoked. 14215490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 14225490a39dSopenharmony_ci * @param { 'wakeupIntelligentVoiceEvent' } type - Type of the event to listen for. Only the wakeupIntelligentVoice event is supported. 14235490a39dSopenharmony_ci * @param { Callback<WakeupIntelligentVoiceEngineCallbackInfo> } callback - the callback invoked when the event is triggered. 14245490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 14255490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 14265490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 14275490a39dSopenharmony_ci * @systemapi 14285490a39dSopenharmony_ci * @since 10 14295490a39dSopenharmony_ci */ 14305490a39dSopenharmony_ci on(type: 'wakeupIntelligentVoiceEvent', callback: Callback<WakeupIntelligentVoiceEngineCallbackInfo>): void; 14315490a39dSopenharmony_ci /** 14325490a39dSopenharmony_ci * Unsubscribes wakeup intelligent voice events. 14335490a39dSopenharmony_ci * @permission ohos.permission.MANAGE_INTELLIGENT_VOICE 14345490a39dSopenharmony_ci * @param { 'wakeupIntelligentVoiceEvent' } type - Type of the event to listen for. Only the wakeupIntelligentVoice event is supported. 14355490a39dSopenharmony_ci * @param { Callback<WakeupIntelligentVoiceEngineCallbackInfo> } [callback] - the callback invoked when the event is triggered. 14365490a39dSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 14375490a39dSopenharmony_ci * @throws { BusinessError } 202 - Not system application. 14385490a39dSopenharmony_ci * @syscap SystemCapability.AI.IntelligentVoice.Core 14395490a39dSopenharmony_ci * @systemapi 14405490a39dSopenharmony_ci * @since 10 14415490a39dSopenharmony_ci */ 14425490a39dSopenharmony_ci off(type: 'wakeupIntelligentVoiceEvent', callback?: Callback<WakeupIntelligentVoiceEngineCallbackInfo>): void; 14435490a39dSopenharmony_ci } 14445490a39dSopenharmony_ci} 14455490a39dSopenharmony_ci 14465490a39dSopenharmony_ciexport default intelligentVoice;