2023-07-11 03:24:10 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
2024-07-05 08:15:35 +00:00
|
|
|
* @kit BasicServicesKit
|
2023-12-11 09:08:03 +00:00
|
|
|
*/
|
|
|
|
|
2023-07-24 03:06:09 +00:00
|
|
|
import type { AsyncCallback, Callback } from './@ohos.base';
|
2023-07-11 03:24:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @namespace intelligentVoice
|
2023-08-16 07:19:59 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
declare namespace intelligentVoice {
|
|
|
|
/**
|
|
|
|
* Obtains an {@link IntelligentVoiceManager} instance.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { IntelligentVoiceManager } this {@link IntelligentVoiceManager} object.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function getIntelligentVoiceManager(): IntelligentVoiceManager;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements intelligent voice management.
|
|
|
|
* @typedef IntelligentVoiceManager
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface IntelligentVoiceManager {
|
|
|
|
/**
|
|
|
|
* Obtains capability information.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { Array<IntelligentVoiceEngineType> } array of supported IntelligentVoiceEngineType.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getCapabilityInfo(): Array<IntelligentVoiceEngineType>;
|
|
|
|
/**
|
|
|
|
* Subscribes service change events. When the state of intelligent voice service changes,
|
|
|
|
* the callback is invoked.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-08-02 11:04:19 +00:00
|
|
|
* @param { 'serviceChange' } type - Type of the event to listen for. Only the serviceChange event is supported.
|
|
|
|
* @param { Callback<ServiceChangeType> } callback - Callback is invoked when the event is triggered.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
on(type: 'serviceChange', callback: Callback<ServiceChangeType>): void;
|
|
|
|
/**
|
|
|
|
* Unsubscribes service change events.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-08-02 11:04:19 +00:00
|
|
|
* @param { 'serviceChange' } type - Type of the event to listen for. Only the serviceChange event is supported.
|
|
|
|
* @param { Callback<ServiceChangeType> } [callback] - Callback is invoked when the event is triggered.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-29 10:00:21 +00:00
|
|
|
off(type: 'serviceChange', callback?: Callback<ServiceChangeType>): void;
|
2023-07-11 03:24:10 +00:00
|
|
|
}
|
|
|
|
|
2024-04-08 03:57:26 +00:00
|
|
|
/**
|
|
|
|
* Implements wakeup management.
|
|
|
|
* @typedef WakeupManager
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
interface WakeupManager {
|
|
|
|
/**
|
|
|
|
* Sets an intelligent voice parameter. This method uses a promise to return the result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @param { string } key - the key of the intelligent voice parameter to set.
|
|
|
|
* @param { string } value - the value of the intelligent voice parameter to set.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
setParameter(key: string, value: string): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @param { string } key - the key of the intelligent voice parameter whose value is to be obtained.
|
|
|
|
* @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
getParameter(key: string): Promise<string>;
|
|
|
|
/**
|
|
|
|
* Obtains files needed to upload. This method uses a promise to return the files needed to upload.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2024-04-26 08:41:14 +00:00
|
|
|
* @param { number } maxCount - the maximum count of upload files. The maxCount should be greater than 0 and smaller than 101
|
2024-04-08 03:57:26 +00:00
|
|
|
* @returns { Promise<Array<UploadFile>> } the promise used to return the upload files.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3.Parameter verification failed.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
getUploadFiles (maxCount: number): Promise<Array<UploadFile>>;
|
|
|
|
/**
|
|
|
|
* Obtains wakeup source files. This method uses a promise to return the wakeup source files.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @returns { Promise<Array<WakeupSourceFile>> } the promise used to return the wakeup source files.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
getWakeupSourceFiles(): Promise<Array<WakeupSourceFile>>;
|
|
|
|
/**
|
|
|
|
* Enrolls with wakeup files for result. This method uses a promise to return the enroll result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @param { Array<WakeupSourceFile> } wakeupFiles - the wakeup source files needed.
|
|
|
|
* @param { string } wakeupInfo - wakeup information.
|
|
|
|
* @returns { Promise<EnrollResult> } the promise used to return the enroll result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enrollWithWakeupFilesForResult(wakeupFiles: Array<WakeupSourceFile>, wakeupInfo: string): Promise<EnrollResult>;
|
|
|
|
/**
|
|
|
|
* Clears user data.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
clearUserData(): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates upload file type.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum UploadFileType {
|
|
|
|
/**
|
|
|
|
* Enroll file.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
ENROLL_FILE = 0,
|
|
|
|
/**
|
|
|
|
* Wakeup file.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
WAKEUP_FILE = 1,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes upload file information.
|
|
|
|
* @typedef UploadFile
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
interface UploadFile {
|
|
|
|
/**
|
|
|
|
* Report file type.
|
|
|
|
* @type { UploadFileType }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
type: UploadFileType;
|
|
|
|
/**
|
|
|
|
* Files description.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
filesDescription: string;
|
|
|
|
/**
|
|
|
|
* Files content.
|
|
|
|
* @type { Array<ArrayBuffer> }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
filesContent: Array<ArrayBuffer>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes wakeup source file information.
|
|
|
|
* @typedef WakeupSourceFile
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
interface WakeupSourceFile {
|
|
|
|
/**
|
|
|
|
* File path.
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
filePath: string;
|
|
|
|
/**
|
|
|
|
* File content.
|
|
|
|
* @type { ArrayBuffer }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
fileContent: ArrayBuffer;
|
|
|
|
}
|
|
|
|
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Enumerates service change type.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum ServiceChangeType {
|
|
|
|
/**
|
|
|
|
* Service unavailable.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
SERVICE_UNAVAILABLE = 0,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates intelligent voice engine type.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum IntelligentVoiceEngineType {
|
|
|
|
/**
|
|
|
|
* Enroll engine.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
ENROLL_ENGINE_TYPE = 0,
|
|
|
|
/**
|
|
|
|
* Wakeup engine.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
WAKEUP_ENGINE_TYPE = 1,
|
|
|
|
/**
|
|
|
|
* Update engine.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
UPDATE_ENGINE_TYPE = 2,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes enroll intelligent voice engine.
|
|
|
|
* @typedef EnrollIntelligentVoiceEngineDescriptor
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface EnrollIntelligentVoiceEngineDescriptor {
|
|
|
|
/**
|
|
|
|
* Wakeup phrase.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
wakeupPhrase: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes wakeup intelligent voice engine.
|
|
|
|
* @typedef WakeupIntelligentVoiceEngineDescriptor
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface WakeupIntelligentVoiceEngineDescriptor {
|
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Need reconfirm.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { boolean }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
needReconfirm: boolean;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Wakeup phrase.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
wakeupPhrase: string;
|
|
|
|
}
|
|
|
|
|
2024-04-08 03:57:26 +00:00
|
|
|
/**
|
|
|
|
* Enumerates evaluation result code.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum EvaluationResultCode {
|
|
|
|
/**
|
|
|
|
* Unknown.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
UNKNOWN = 0,
|
|
|
|
/**
|
|
|
|
* Pass.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
PASS = 1,
|
|
|
|
/**
|
|
|
|
* Word is empty.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
WORD_EMPTY = 2,
|
|
|
|
/**
|
|
|
|
* Only chinese is supported.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CHINESE_ONLY = 3,
|
|
|
|
/**
|
|
|
|
* Invalid length.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
INVALID_LENGTH = 4,
|
|
|
|
/**
|
|
|
|
* Unusual word.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
UNUSUAL_WORD = 5,
|
|
|
|
/**
|
|
|
|
* Consecutive same word.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CONSECUTIVE_SAME_WORD = 6,
|
|
|
|
/**
|
|
|
|
* Too few phonemes.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
TOO_FEW_PHONEMES = 7,
|
|
|
|
/**
|
|
|
|
* Too many phonemes.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
TOO_MANY_PHONEMES = 8,
|
|
|
|
/**
|
|
|
|
* Contain common instruction.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
COMMON_INSTRUCTION = 9,
|
|
|
|
/**
|
|
|
|
* Contain common spoken language.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
COMMON_SPOKEN_LANGUAGE = 10,
|
|
|
|
/**
|
|
|
|
* Contain sensitive word.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
SENSITIVE_WORD = 11,
|
|
|
|
/**
|
|
|
|
* Two consecutive words without initial consonant.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
NO_INITIAL_CONSONANT = 12,
|
|
|
|
/**
|
|
|
|
* Contain repeated phoneme.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
REPEATED_PHONEME = 13,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes evaluation result.
|
|
|
|
* @typedef EvaluationResult
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
interface EvaluationResult {
|
|
|
|
/**
|
|
|
|
* Evaluation score.
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
score: number;
|
|
|
|
/**
|
|
|
|
* Describes evaluation result code.
|
|
|
|
* @type { EvaluationResultCode }
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
resultCode: EvaluationResultCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains an {@link WakeupManager} instance.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @returns { WakeupManager } this {@link WakeupManager} object.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
function getWakeupManager(): WakeupManager;
|
|
|
|
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Obtains an {@link EnrollIntelligentVoiceEngine} instance. This method uses an asynchronous callback to return the EnrollIntelligentVoiceEngine instance.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { EnrollIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates enroll intelligent voice engine descriptor.
|
|
|
|
* @param { AsyncCallback<EnrollIntelligentVoiceEngine> } callback - the callback used to return the EnrollIntelligentVoiceEngine instance.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function createEnrollIntelligentVoiceEngine(descriptor: EnrollIntelligentVoiceEngineDescriptor, callback: AsyncCallback<EnrollIntelligentVoiceEngine>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains an {@link EnrollIntelligentVoiceEngine} instance. This method uses a promise to return the EnrollIntelligentVoiceEngine instance.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { EnrollIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates enroll intelligent voice engine descriptor.
|
2023-08-02 11:04:19 +00:00
|
|
|
* @returns { Promise<EnrollIntelligentVoiceEngine> } the promise used to return the EnrollIntelligentVoiceEngine instance.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function createEnrollIntelligentVoiceEngine(descriptor: EnrollIntelligentVoiceEngineDescriptor): Promise<EnrollIntelligentVoiceEngine>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains an {@link WakeupIntelligentVoiceEngine} instance. This method uses an asynchronous callback to return the WakeupIntelligentVoiceEngine instance.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { WakeupIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates wakeup intelligent voice engine descriptor.
|
|
|
|
* @param { AsyncCallback<WakeupIntelligentVoiceEngine> } callback - the callback used to return the WakeupIntelligentVoiceEngine instance.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function createWakeupIntelligentVoiceEngine(descriptor: WakeupIntelligentVoiceEngineDescriptor, callback: AsyncCallback<WakeupIntelligentVoiceEngine>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains an {@link WakeupIntelligentVoiceEngine} instance. This method uses a promise to return the WakeupIntelligentVoiceEngine instance.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { WakeupIntelligentVoiceEngineDescriptor } descriptor - descriptor indicates wakeup intelligent voice engine descriptor.
|
|
|
|
* @returns { Promise<WakeupIntelligentVoiceEngine> } the promise used to return the WakeupIntelligentVoiceEngine instance.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function createWakeupIntelligentVoiceEngine(descriptor: WakeupIntelligentVoiceEngineDescriptor): Promise<WakeupIntelligentVoiceEngine>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes enroll engine config.
|
|
|
|
* @typedef EnrollEngineConfig
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface EnrollEngineConfig {
|
|
|
|
/**
|
|
|
|
* Language that enroll engine supports.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
language: string;
|
|
|
|
/**
|
|
|
|
* Region that enroll engine supports.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
region: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates sensibility type.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum SensibilityType {
|
|
|
|
/**
|
|
|
|
* Low sensibility.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
LOW_SENSIBILITY = 1,
|
|
|
|
/**
|
|
|
|
* Middle sensibility.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
MIDDLE_SENSIBILITY = 2,
|
|
|
|
/**
|
|
|
|
* High sensibility.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
HIGH_SENSIBILITY = 3,
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes wakeup hap information.
|
|
|
|
* @typedef WakeupHapInfo
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface WakeupHapInfo {
|
|
|
|
/**
|
|
|
|
* Bundle name.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
bundleName: string;
|
|
|
|
/**
|
|
|
|
* Ability name.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
abilityName: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates wakeup intelligent voice event type.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum WakeupIntelligentVoiceEventType {
|
|
|
|
/**
|
|
|
|
* Wakeup None.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_EVENT_WAKEUP_NONE = 0,
|
|
|
|
/**
|
|
|
|
* Recognize complete.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_EVENT_RECOGNIZE_COMPLETE = 1,
|
2024-07-05 08:15:35 +00:00
|
|
|
/**
|
|
|
|
* Headset Recognize complete.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_EVENT_HEADSET_RECOGNIZE_COMPLETE = 2,
|
2023-07-11 03:24:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates intelligent voice error code.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
enum IntelligentVoiceErrorCode {
|
|
|
|
/**
|
2023-07-29 10:00:21 +00:00
|
|
|
* No memory.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-29 10:00:21 +00:00
|
|
|
INTELLIGENT_VOICE_NO_MEMORY = 22700101,
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2024-07-05 08:15:35 +00:00
|
|
|
* Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-29 10:00:21 +00:00
|
|
|
INTELLIGENT_VOICE_INVALID_PARAM = 22700102,
|
2023-07-31 07:20:55 +00:00
|
|
|
/**
|
|
|
|
* Init failed.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-31 07:20:55 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_INIT_FAILED = 22700103,
|
|
|
|
/**
|
2024-07-05 08:15:35 +00:00
|
|
|
* Failed to commit the enrollment.
|
2023-07-31 07:20:55 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-31 07:20:55 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_COMMIT_ENROLL_FAILED = 22700104,
|
2024-04-08 03:57:26 +00:00
|
|
|
/**
|
|
|
|
* Start capturer failed.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_START_CAPTURER_FAILED = 22700105,
|
|
|
|
/**
|
|
|
|
* Read failed.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_READ_FAILED = 22700106,
|
|
|
|
/**
|
|
|
|
* System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
INTELLIGENT_VOICE_SYSTEM_ERROR = 22700107,
|
2023-07-29 10:00:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Enumerates enroll result.
|
2023-07-29 10:00:21 +00:00
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-29 10:00:21 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
enum EnrollResult {
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-29 10:00:21 +00:00
|
|
|
* Success.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
SUCCESS = 0,
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Vpr train failed.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
VPR_TRAIN_FAILED = -1,
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Wakeup phrase not match.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
WAKEUP_PHRASE_NOT_MATCH = -2,
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Too noisy.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-31 07:20:55 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
TOO_NOISY = -3,
|
|
|
|
/**
|
2023-07-31 11:01:39 +00:00
|
|
|
* Too loud.
|
2023-07-31 07:20:55 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-31 07:20:55 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 11:01:39 +00:00
|
|
|
TOO_LOUD = -4,
|
2023-07-31 07:20:55 +00:00
|
|
|
/**
|
|
|
|
* Interval large.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
INTERVAL_LARGE = -5,
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Different person.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
DIFFERENT_PERSON = -6,
|
|
|
|
/**
|
|
|
|
* Unknown error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-31 07:20:55 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
UNKNOWN_ERROR = -100,
|
2023-07-11 03:24:10 +00:00
|
|
|
}
|
|
|
|
|
2024-04-08 03:57:26 +00:00
|
|
|
/**
|
|
|
|
* Enumerates capturer channel.
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum CapturerChannel {
|
|
|
|
/**
|
|
|
|
* Capturer channel 1.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CAPTURER_CHANNEL_1 = 0x1 << 0,
|
|
|
|
/**
|
|
|
|
* Capturer channel 2.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CAPTURER_CHANNEL_2 = 0x1 << 1,
|
|
|
|
/**
|
|
|
|
* Capturer channel 3.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CAPTURER_CHANNEL_3 = 0x1 << 2,
|
|
|
|
/**
|
|
|
|
* Capturer channel 4.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CAPTURER_CHANNEL_4 = 0x1 << 3,
|
|
|
|
}
|
|
|
|
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Describes enroll callback information.
|
|
|
|
* @typedef EnrollCallbackInfo
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
interface EnrollCallbackInfo {
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-29 10:00:21 +00:00
|
|
|
* Result.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { EnrollResult }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
result: EnrollResult;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Describes enroll event context.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
context: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes wakeup intelligent voice engine callback information.
|
|
|
|
* @typedef WakeupIntelligentVoiceEngineCallbackInfo
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface WakeupIntelligentVoiceEngineCallbackInfo {
|
|
|
|
/**
|
|
|
|
* Wakeup event id.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { WakeupIntelligentVoiceEventType }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
eventId: WakeupIntelligentVoiceEventType;
|
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Is success.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { boolean }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
isSuccess: boolean;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Describes wakeup event context.
|
2023-07-31 11:01:39 +00:00
|
|
|
* @type { string }
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
context: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements enroll intelligent voice engine.
|
|
|
|
* @typedef EnrollIntelligentVoiceEngine
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface EnrollIntelligentVoiceEngine {
|
|
|
|
/**
|
|
|
|
* Obtains the supported regions, This method uses an asynchronous callback to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { AsyncCallback<Array<string>> } callback - the callback used to return the supported regions.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getSupportedRegions(callback: AsyncCallback<Array<string>>): void;
|
|
|
|
/**
|
|
|
|
* Obtains the supported regions, This method uses a promise to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { Promise<Array<string>> } the promise used to return the supported regions.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getSupportedRegions(): Promise<Array<string>>;
|
|
|
|
/**
|
|
|
|
* Initials the engine, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { EnrollEngineConfig } config - config indicates enroll engine configuration.
|
2023-07-31 07:20:55 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-31 07:20:55 +00:00
|
|
|
* @throws { BusinessError } 22700103 - Init failed.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
init(config: EnrollEngineConfig, callback: AsyncCallback<void>): void;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Initials the engine, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { EnrollEngineConfig } config - config indicates enroll engine configuration.
|
2023-07-31 07:20:55 +00:00
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-31 07:20:55 +00:00
|
|
|
* @throws { BusinessError } 22700103 - Init failed.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
init(config: EnrollEngineConfig): Promise<void>;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Enrolls for result, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-31 07:20:55 +00:00
|
|
|
* @param { boolean } isLast - isLast indicates if it is the last time to enroll.
|
|
|
|
* @param { AsyncCallback<EnrollCallbackInfo> } callback - the callback used to return the result.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
enrollForResult(isLast: boolean, callback: AsyncCallback<EnrollCallbackInfo>): void;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-07-31 07:20:55 +00:00
|
|
|
* Enrolls for result, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-31 07:20:55 +00:00
|
|
|
* @param { boolean } isLast - isLast indicates if it is the last time to enroll.
|
|
|
|
* @returns { Promise<EnrollCallbackInfo> } the promise used to return the result.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
enrollForResult(isLast: boolean): Promise<EnrollCallbackInfo>;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Stops the engine, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
stop(callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Stops the engine, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
stop(): Promise<void>;
|
|
|
|
/**
|
2023-08-02 08:12:00 +00:00
|
|
|
* Commit enroll, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-31 07:20:55 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700104 - Failed to commit the enrollment.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
commit(callback: AsyncCallback<void>): void;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
2023-08-02 08:12:00 +00:00
|
|
|
* Commit enroll, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-31 07:20:55 +00:00
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700104 - Failed to commit the enrollment.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-31 07:20:55 +00:00
|
|
|
commit(): Promise<void>;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Sets wakeup hap information, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { WakeupHapInfo } info - info indicates wakeup hap information.
|
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setWakeupHapInfo(info: WakeupHapInfo, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Sets wakeup hap information, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { WakeupHapInfo } info - info indicates wakeup hap information.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setWakeupHapInfo(info: WakeupHapInfo): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Sets sensibility, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { SensibilityType } sensibility - sensibility to set.
|
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setSensibility(sensibility: SensibilityType, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Sets sensibility, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { SensibilityType } sensibility - sensibility to set.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setSensibility(sensibility: SensibilityType): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Sets an intelligent voice parameter. This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter to set.
|
|
|
|
* @param { string } value - the value of the intelligent voice parameter to set.
|
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setParameter(key: string, value: string, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Sets an intelligent voice parameter. This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter to set.
|
|
|
|
* @param { string } value - the value of the intelligent voice parameter to set.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setParameter(key: string, value: string): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Obtains the value of an intelligent voice parameter. This method uses an asynchronous callback to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter whose value is to be obtained.
|
|
|
|
* @param { AsyncCallback<string> } callback - the callback used to return the value of the intelligent voice parameter.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getParameter(key: string, callback: AsyncCallback<string>): void;
|
|
|
|
/**
|
2024-04-08 03:57:26 +00:00
|
|
|
* Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter whose value is to be obtained.
|
|
|
|
* @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getParameter(key: string): Promise<string>;
|
2024-04-08 03:57:26 +00:00
|
|
|
/**
|
|
|
|
* Evaluates for result, This method uses a promise to return the result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @param { string } word - the word to evaluate.
|
|
|
|
* @returns { Promise<EvaluationResult> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
evaluateForResult(word: string): Promise<EvaluationResult>;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Releases the engine, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
release(callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Releases the engine, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
release(): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements wakeup intelligent voice engine.
|
|
|
|
* @typedef WakeupIntelligentVoiceEngine
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface WakeupIntelligentVoiceEngine {
|
|
|
|
/**
|
|
|
|
* Obtains the supported regions, This method uses an asynchronous callback to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { AsyncCallback<Array<string>> } callback - the callback used to return the supported regions.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getSupportedRegions(callback: AsyncCallback<Array<string>>): void;
|
|
|
|
/**
|
|
|
|
* Obtains the supported regions, This method uses a promise to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { Promise<Array<string>> } the promise used to return the supported regions.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getSupportedRegions(): Promise<Array<string>>;
|
|
|
|
/**
|
|
|
|
* Sets wakeup hap information, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { WakeupHapInfo } info - info indicates wakeup hap information.
|
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setWakeupHapInfo(info: WakeupHapInfo, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Sets wakeup hap information, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { WakeupHapInfo } info - info indicates wakeup hap information.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setWakeupHapInfo(info: WakeupHapInfo): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Sets sensibility, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { SensibilityType } sensibility - sensibility to set.
|
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setSensibility(sensibility: SensibilityType, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Sets sensibility, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { SensibilityType } sensibility - sensibility to set.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setSensibility(sensibility: SensibilityType): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Sets an intelligent voice parameter. This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter to set.
|
|
|
|
* @param { string } value - the value of the intelligent voice parameter to set.
|
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setParameter(key: string, value: string, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Sets an intelligent voice parameter. This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter to set.
|
|
|
|
* @param { string } value - the value of the intelligent voice parameter to set.
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
setParameter(key: string, value: string): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Obtains the value of an intelligent voice parameter. This method uses an asynchronous callback to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter whose value is to be obtained.
|
|
|
|
* @param { AsyncCallback<string> } callback - the callback used to return the value of the intelligent voice parameter.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getParameter(key: string, callback: AsyncCallback<string>): void;
|
|
|
|
/**
|
2024-04-08 03:57:26 +00:00
|
|
|
* Obtains the value of an intelligent voice parameter. This method uses a promise to return the query result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { string } key - the key of the intelligent voice parameter whose value is to be obtained.
|
|
|
|
* @returns { Promise<string> } the promise used to return the value of the intelligent voice parameter.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
getParameter(key: string): Promise<string>;
|
2024-04-08 03:57:26 +00:00
|
|
|
/**
|
|
|
|
* Gets pulse-code modulation audio. This method uses a promise to return the result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @returns { Promise<ArrayBuffer> } the promise used to return the pulse-code modulation audio.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
getPcm(): Promise<ArrayBuffer>;
|
|
|
|
/**
|
|
|
|
* Starts the capturer. This method uses a promise to return the result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2024-04-26 08:41:14 +00:00
|
|
|
* @param { number } channels - the channels needed in reading. The channels should be greater than 0 and smaller than 16.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-26 08:41:14 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. 3.Parameter verification failed.
|
2024-07-05 08:15:35 +00:00
|
|
|
* @throws { BusinessError } 22700102 - Invalid parameter.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700105 - Start capturer failed.
|
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
startCapturer(channels: number): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Reads the buffer from wakeup engine. This method uses a promise to return the result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @returns { Promise<ArrayBuffer> } the promise used to return the buffer.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700101 - No memory.
|
|
|
|
* @throws { BusinessError } 22700106 - Read failed.
|
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
read(): Promise<ArrayBuffer>;
|
|
|
|
/**
|
|
|
|
* Stops the capturer. This method uses a promise to return the result.
|
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2024-04-08 03:57:26 +00:00
|
|
|
* @throws { BusinessError } 22700107 - System error.
|
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
stopCapturer(): Promise<void>;
|
2023-07-11 03:24:10 +00:00
|
|
|
/**
|
|
|
|
* Releases the engine, This method uses an asynchronous callback to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { AsyncCallback<void> } callback - the callback used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
release(callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Releases the engine, This method uses a promise to return the result.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-07-11 03:24:10 +00:00
|
|
|
* @returns { Promise<void> } the promise used to return the result.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
release(): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Subscribes wakeup intelligent voice events. When wakeup intelligent voice events reach,
|
|
|
|
* the callback is invoked.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-08-02 11:04:19 +00:00
|
|
|
* @param { 'wakeupIntelligentVoiceEvent' } type - Type of the event to listen for. Only the wakeupIntelligentVoice event is supported.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @param { Callback<WakeupIntelligentVoiceEngineCallbackInfo> } callback - the callback invoked when the event is triggered.
|
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
on(type: 'wakeupIntelligentVoiceEvent', callback: Callback<WakeupIntelligentVoiceEngineCallbackInfo>): void;
|
|
|
|
/**
|
|
|
|
* Unsubscribes wakeup intelligent voice events.
|
2023-07-11 07:52:22 +00:00
|
|
|
* @permission ohos.permission.MANAGE_INTELLIGENT_VOICE
|
2023-08-02 11:04:19 +00:00
|
|
|
* @param { 'wakeupIntelligentVoiceEvent' } type - Type of the event to listen for. Only the wakeupIntelligentVoice event is supported.
|
|
|
|
* @param { Callback<WakeupIntelligentVoiceEngineCallbackInfo> } [callback] - the callback invoked when the event is triggered.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @throws { BusinessError } 201 - Permission denied.
|
2024-08-17 07:06:01 +00:00
|
|
|
* @throws { BusinessError } 202 - Not system application.
|
2023-07-11 03:24:10 +00:00
|
|
|
* @syscap SystemCapability.AI.IntelligentVoice.Core
|
2023-08-16 07:19:59 +00:00
|
|
|
* @systemapi
|
2023-07-11 03:24:10 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-07-29 10:00:21 +00:00
|
|
|
off(type: 'wakeupIntelligentVoiceEvent', callback?: Callback<WakeupIntelligentVoiceEngineCallbackInfo>): void;
|
2023-07-11 03:24:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default intelligentVoice;
|