@picovoice/eagle-web 1.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,201 +1,238 @@
1
- import { Mutex } from 'async-mutex';
2
- import { aligned_alloc_type, pv_free_type, PvError } from '@picovoice/web-utils';
3
- import { EagleModel, EagleProfile, EagleProfilerEnrollResult } from './types';
4
- type pv_status_to_string_type = (status: number) => Promise<number>;
5
- type pv_get_error_stack_type = (messageStack: number, messageStackDepth: number) => Promise<number>;
6
- type pv_free_error_stack_type = (messageStack: number) => Promise<void>;
7
- type EagleBaseWasmOutput = {
8
- memory: WebAssembly.Memory;
9
- alignedAlloc: aligned_alloc_type;
10
- pvFree: pv_free_type;
11
- pvError: PvError;
12
- sampleRate: number;
13
- version: string;
14
- messageStackAddressAddressAddress: number;
15
- messageStackDepthAddress: number;
16
- pvStatusToString: pv_status_to_string_type;
17
- pvGetErrorStack: pv_get_error_stack_type;
18
- pvFreeErrorStack: pv_free_error_stack_type;
19
- exports: any;
20
- };
21
- declare class EagleBase {
22
- protected readonly _pvStatusToString: pv_status_to_string_type;
23
- protected _wasmMemory: WebAssembly.Memory | undefined;
24
- protected readonly _alignedAlloc: CallableFunction;
25
- protected readonly _pvFree: pv_free_type;
26
- protected readonly _functionMutex: Mutex;
27
- protected readonly _pvGetErrorStack: pv_get_error_stack_type;
28
- protected readonly _pvFreeErrorStack: pv_free_error_stack_type;
29
- protected readonly _messageStackAddressAddressAddress: number;
30
- protected readonly _messageStackDepthAddress: number;
31
- protected static _sampleRate: number;
32
- protected static _version: string;
33
- protected static _wasm: string;
34
- protected static _wasmSimd: string;
35
- protected static _sdk: string;
36
- protected static _eagleMutex: Mutex;
37
- protected readonly _pvError: PvError;
38
- protected constructor(handleWasm: EagleBaseWasmOutput);
39
- /**
40
- * Audio sample rate required by Eagle.
41
- */
42
- get sampleRate(): number;
43
- /**
44
- * Version of Eagle.
45
- */
46
- get version(): string;
47
- /**
48
- * Set base64 wasm file.
49
- * @param wasm Base64'd wasm file to use to initialize wasm.
50
- */
51
- static setWasm(wasm: string): void;
52
- /**
53
- * Set base64 wasm file with SIMD feature.
54
- * @param wasmSimd Base64'd wasm file to use to initialize wasm.
55
- */
56
- static setWasmSimd(wasmSimd: string): void;
57
- static setSdk(sdk: string): void;
58
- protected static _initBaseWasm(wasmBase64: string, wasmMemorySize: number): Promise<EagleBaseWasmOutput>;
59
- /**
60
- * Releases resources acquired by Eagle
61
- */
62
- release(): Promise<void>;
63
- protected static getMessageStack(pv_get_error_stack: pv_get_error_stack_type, pv_free_error_stack: pv_free_error_stack_type, messageStackAddressAddressAddress: number, messageStackDepthAddress: number, memoryBufferView: DataView, memoryBufferUint8: Uint8Array): Promise<string[]>;
64
- }
65
- /**
66
- * JavaScript/WebAssembly binding for the profiler of the Eagle Speaker Recognition engine.
67
- * It enrolls a speaker given a set of utterances and then constructs a profile for the enrolled speaker.
68
- */
69
- export declare class EagleProfiler extends EagleBase {
70
- private readonly _pvEagleProfilerDelete;
71
- private readonly _pvEagleProfilerEnroll;
72
- private readonly _pvEagleProfilerExport;
73
- private readonly _pvEagleProfilerReset;
74
- private readonly _objectAddress;
75
- private static _maxEnrollSamples;
76
- private static _minEnrollSamples;
77
- private static _profileSize;
78
- private constructor();
79
- /**
80
- * The minimum length of the input pcm required by `.enroll()`.
81
- */
82
- get minEnrollSamples(): number;
83
- /**
84
- * Creates an instance of profiler component of the Eagle Speaker Recognition Engine.
85
- *
86
- * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
87
- * @param model Eagle model options.
88
- * @param model.base64 The model in base64 string to initialize Eagle.
89
- * @param model.publicPath The model path relative to the public directory.
90
- * @param model.customWritePath Custom path to save the model in storage.
91
- * Set to a different name to use multiple models across `eagle` instances.
92
- * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
93
- * @param model.version Version of the model file. Increment to update the model file in storage.
94
- *
95
- * @return An instance of the Eagle Profiler.
96
- */
97
- static create(accessKey: string, model: EagleModel): Promise<EagleProfiler>;
98
- static _init(accessKey: string, modelPath: string): Promise<EagleProfiler>;
99
- /**
100
- * Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker
101
- * until `percentage` reaches `100.0`, at which point a speaker voice profile can be exported using `.export()`.
102
- * Any further enrollment can be used to improve the speaker profile. The minimum length of the input pcm to
103
- * `.enroll()` can be obtained by calling `.minEnrollSamples`.
104
- * The audio data used for enrollment should satisfy the following requirements:
105
- * - only one speaker should be present in the audio
106
- * - the speaker should be speaking in a normal voice
107
- * - the audio should contain no speech from other speakers and no other sounds (e.g. music)
108
- * - it should be captured in a quiet environment with no background noise
109
- * @param pcm Audio data for enrollment. The audio needs to have a sample rate equal to `.sampleRate` and be
110
- * 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.
111
- *
112
- * @return The percentage of completeness of the speaker enrollment process along with the feedback code
113
- * corresponding to the last enrollment attempt:
114
- * - `AUDIO_OK`: The audio is good for enrollment.
115
- * - `AUDIO_TOO_SHORT`: Audio length is insufficient for enrollment,
116
- * i.e. it is shorter than`.min_enroll_samples`.
117
- * - `UNKNOWN_SPEAKER`: There is another speaker in the audio that is different from the speaker
118
- * being enrolled. Too much background noise may cause this error as well.
119
- * - `NO_VOICE_FOUND`: The audio does not contain any voice, i.e. it is silent or
120
- * has a low signal-to-noise ratio.
121
- * - `QUALITY_ISSUE`: The audio quality is too low for enrollment due to a bad microphone
122
- * or recording environment.
123
- */
124
- enroll(pcm: Int16Array): Promise<EagleProfilerEnrollResult>;
125
- /**
126
- * Exports the speaker profile of the current session.
127
- * Will throw error if the profile is not ready.
128
- *
129
- * @return An EagleProfile object.
130
- */
131
- export(): Promise<EagleProfile>;
132
- /**
133
- * Resets the internal state of Eagle Profiler.
134
- * It should be called before starting a new enrollment session.
135
- */
136
- reset(): Promise<void>;
137
- /**
138
- * Releases resources acquired by Eagle Profiler
139
- */
140
- release(): Promise<void>;
141
- private static _initProfilerWasm;
142
- }
143
- /**
144
- * JavaScript/WebAssembly binding for Eagle Speaker Recognition engine.
145
- * It processes incoming audio in consecutive frames and emits a similarity score for each enrolled speaker.
146
- */
147
- export declare class Eagle extends EagleBase {
148
- private readonly _pvEagleDelete;
149
- private readonly _pvEagleProcess;
150
- private readonly _pvEagleReset;
151
- private readonly _objectAddress;
152
- private readonly _scoresAddress;
153
- private readonly _numSpeakers;
154
- private static _frameLength;
155
- private constructor();
156
- /**
157
- * Number of audio samples per frame expected by Eagle (i.e. length of the array passed into `.process()`)
158
- */
159
- get frameLength(): number;
160
- /**
161
- * Creates an instance of the Picovoice Eagle Speaker Recognition Engine.
162
- *
163
- * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
164
- * @param model Eagle model options.
165
- * @param model.base64 The model in base64 string to initialize Eagle.
166
- * @param model.publicPath The model path relative to the public directory.
167
- * @param model.customWritePath Custom path to save the model in storage.
168
- * Set to a different name to use multiple models across `eagle` instances.
169
- * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
170
- * @param model.version Version of the model file. Increment to update the model file in storage.
171
- * @param speakerProfiles One or more Eagle speaker profiles. These can be constructed using `EagleProfiler`.
172
- *
173
- * @return An instance of the Eagle engine.
174
- */
175
- static create(accessKey: string, model: EagleModel, speakerProfiles: EagleProfile[] | EagleProfile): Promise<Eagle>;
176
- static _init(accessKey: string, modelPath: string, speakerProfiles: EagleProfile[]): Promise<Eagle>;
177
- /**
178
- * Processes a frame of audio and returns a list of similarity scores for each speaker profile.
179
- *
180
- * @param pcm A frame of audio samples. The number of samples per frame can be attained by calling
181
- * `.frameLength`. The incoming audio needs to have a sample rate equal to `.sampleRate` and be 16-bit
182
- * linearly-encoded. Eagle operates on single-channel audio.
183
- *
184
- * @return A list of similarity scores for each speaker profile. A higher score indicates that the voice
185
- * belongs to the corresponding speaker. The range is [0, 1] with 1.0 representing a perfect match.
186
- */
187
- process(pcm: Int16Array): Promise<number[]>;
188
- /**
189
- * Resets the internal state of the engine.
190
- * It is best to call before processing a new sequence of audio (e.g. a new voice interaction).
191
- * This ensures that the accuracy of the engine is not affected by a change in audio context.
192
- */
193
- reset(): Promise<void>;
194
- /**
195
- * Releases resources acquired by Eagle
196
- */
197
- release(): Promise<void>;
198
- private static _initWasm;
199
- }
200
- export {};
1
+ /// <reference types="emscripten" />
2
+ import { Mutex } from 'async-mutex';
3
+ import { EagleModel, EagleOptions, EagleProfile, EagleProfilerOptions } from './types';
4
+ type pv_eagle_profiler_frame_length_type = () => number;
5
+ type pv_eagle_profiler_export_type = (object: number, speakerProfile: number) => number;
6
+ type pv_eagle_profiler_export_size_type = (object: number, speakerProfileSizeBytes: number) => number;
7
+ type pv_eagle_process_min_audio_length_samples_type = (object: number, numSamples: number) => number;
8
+ type pv_eagle_version_type = () => number;
9
+ type pv_eagle_list_hardware_devices_type = (hardwareDevices: number, numHardwareDevices: number) => number;
10
+ type pv_eagle_free_hardware_devices_type = (hardwareDevices: number, numHardwareDevices: number) => number;
11
+ type pv_sample_rate_type = () => number;
12
+ type pv_set_sdk_type = (sdk: number) => void;
13
+ type pv_get_error_stack_type = (messageStack: number, messageStackDepth: number) => number;
14
+ type pv_free_error_stack_type = (messageStack: number) => void;
15
+ type EagleModule = EmscriptenModule & {
16
+ _pv_free: (address: number) => void;
17
+ _pv_eagle_profiler_export: pv_eagle_profiler_export_type;
18
+ _pv_eagle_profiler_export_size: pv_eagle_profiler_export_size_type;
19
+ _pv_eagle_profiler_frame_length: pv_eagle_profiler_frame_length_type;
20
+ _pv_eagle_process_min_audio_length_samples: pv_eagle_process_min_audio_length_samples_type;
21
+ _pv_eagle_version: pv_eagle_version_type;
22
+ _pv_eagle_list_hardware_devices: pv_eagle_list_hardware_devices_type;
23
+ _pv_eagle_free_hardware_devices: pv_eagle_free_hardware_devices_type;
24
+ _pv_sample_rate: pv_sample_rate_type;
25
+ _pv_set_sdk: pv_set_sdk_type;
26
+ _pv_get_error_stack: pv_get_error_stack_type;
27
+ _pv_free_error_stack: pv_free_error_stack_type;
28
+ addFunction: typeof addFunction;
29
+ ccall: typeof ccall;
30
+ cwrap: typeof cwrap;
31
+ };
32
+ type EagleBaseWasmOutput = {
33
+ module: EagleModule;
34
+ sampleRate: number;
35
+ version: string;
36
+ messageStackAddressAddressAddress: number;
37
+ messageStackDepthAddress: number;
38
+ };
39
+ declare class EagleBase {
40
+ protected _module?: EagleModule;
41
+ protected readonly _functionMutex: Mutex;
42
+ protected readonly _messageStackAddressAddressAddress: number;
43
+ protected readonly _messageStackDepthAddress: number;
44
+ protected readonly _sampleRate: number;
45
+ protected readonly _version: string;
46
+ protected static _wasmSimd: string;
47
+ protected static _wasmSimdLib: string;
48
+ protected static _wasmPThread: string;
49
+ protected static _wasmPThreadLib: string;
50
+ protected static _sdk: string;
51
+ protected static _eagleMutex: Mutex;
52
+ protected constructor(handleWasm: EagleBaseWasmOutput);
53
+ /**
54
+ * Audio sample rate required by Eagle.
55
+ */
56
+ get sampleRate(): number;
57
+ /**
58
+ * Version of Eagle.
59
+ */
60
+ get version(): string;
61
+ /**
62
+ * Set base64 wasm file with SIMD feature.
63
+ * @param wasmSimd Base64'd wasm file to use to initialize wasm.
64
+ */
65
+ static setWasmSimd(wasmSimd: string): void;
66
+ /**
67
+ * Set base64 SIMD wasm file in text format.
68
+ * @param wasmSimdLib Base64'd wasm file in text format.
69
+ */
70
+ static setWasmSimdLib(wasmSimdLib: string): void;
71
+ /**
72
+ * Set base64 wasm file with SIMD and pthread feature.
73
+ * @param wasmPThread Base64'd wasm file to use to initialize wasm.
74
+ */
75
+ static setWasmPThread(wasmPThread: string): void;
76
+ /**
77
+ * Set base64 SIMD and thread wasm file in text format.
78
+ * @param wasmPThreadLib Base64'd wasm file in text format.
79
+ */
80
+ static setWasmPThreadLib(wasmPThreadLib: string): void;
81
+ static setSdk(sdk: string): void;
82
+ protected static _initBaseWasm(wasmBase64: string, wasmLibBase64: string, createModuleFunc: any): Promise<EagleBaseWasmOutput>;
83
+ /**
84
+ * Releases resources acquired by Eagle
85
+ */
86
+ release(): Promise<void>;
87
+ protected static getMessageStack(pv_get_error_stack: pv_get_error_stack_type, pv_free_error_stack: pv_free_error_stack_type, messageStackAddressAddressAddress: number, messageStackDepthAddress: number, memoryBufferInt32: Int32Array, memoryBufferUint8: Uint8Array): Promise<string[]>;
88
+ protected static wrapAsyncFunction(module: EagleModule, functionName: string, numArgs: number): (...args: any[]) => any;
89
+ }
90
+ /**
91
+ * JavaScript/WebAssembly binding for the profiler of the Eagle Speaker Recognition engine.
92
+ * It enrolls a speaker given a set of utterances and then constructs a profile for the enrolled speaker.
93
+ */
94
+ export declare class EagleProfiler extends EagleBase {
95
+ private readonly _pv_eagle_profiler_enroll;
96
+ private readonly _pv_eagle_profiler_flush;
97
+ private readonly _pv_eagle_profiler_reset;
98
+ private readonly _pv_eagle_profiler_delete;
99
+ private readonly _objectAddress;
100
+ private readonly _percentageAddress;
101
+ private readonly _frameLength;
102
+ private readonly _profileSize;
103
+ private constructor();
104
+ /**
105
+ * The length of the input pcm required by `.enroll()`.
106
+ */
107
+ get frameLength(): number;
108
+ /**
109
+ * Creates an instance of profiler component of the Eagle Speaker Recognition Engine.
110
+ *
111
+ * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
112
+ * @param model Eagle model options.
113
+ * @param model.base64 The model in base64 string to initialize Eagle.
114
+ * @param model.publicPath The model path relative to the public directory.
115
+ * @param model.customWritePath Custom path to save the model in storage.
116
+ * Set to a different name to use multiple models across `eagle` instances.
117
+ * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
118
+ * @param model.version Version of the model file. Increment to update the model file in storage.
119
+ * @param options Optional configuration arguments.
120
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
121
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
122
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
123
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
124
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
125
+ * @param options.minEnrollmentChunks Minimum number of chunks to be processed before enroll returns 100%
126
+ * @param options.voiceThreshold Sensitivity threshold for detecting voice.
127
+ *
128
+ * @return An instance of the Eagle Profiler.
129
+ */
130
+ static create(accessKey: string, model: EagleModel, options?: EagleProfilerOptions): Promise<EagleProfiler>;
131
+ static _init(accessKey: string, modelPath: string, options?: EagleProfilerOptions): Promise<EagleProfiler>;
132
+ /**
133
+ * Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker
134
+ * until `percentage` reaches `100.0`, at which point a speaker voice profile can be exported using `.export()`.
135
+ * Any further enrollment can be used to improve the speaker profile. The minimum length of the input pcm to
136
+ * `.enroll()` can be obtained by calling `.minEnrollSamples`.
137
+ * The audio data used for enrollment should satisfy the following requirements:
138
+ * - only one speaker should be present in the audio
139
+ * - the speaker should be speaking in a normal voice
140
+ * - the audio should contain no speech from other speakers and no other sounds (e.g. music)
141
+ * - it should be captured in a quiet environment with no background noise
142
+ * @param pcm Audio data for enrollment. The audio needs to have a sample rate equal to `.sampleRate` and be
143
+ * 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.
144
+ *
145
+ * @return The percentage of completeness of the speaker enrollment process.
146
+ */
147
+ enroll(pcm: Int16Array): Promise<number>;
148
+ /**
149
+ * Marks the end of the audio stream, flushes internal state of the object, and returns the percentage of enrollment
150
+ * completed.
151
+ *
152
+ * @return The percentage of completeness of the speaker enrollment process.
153
+ */
154
+ flush(): Promise<number>;
155
+ /**
156
+ * Exports the speaker profile of the current session.
157
+ * Will throw error if the profile is not ready.
158
+ *
159
+ * @return An EagleProfile object.
160
+ */
161
+ export(): Promise<EagleProfile>;
162
+ /**
163
+ * Resets the internal state of Eagle Profiler.
164
+ * It should be called before starting a new enrollment session.
165
+ */
166
+ reset(): Promise<void>;
167
+ /**
168
+ * Releases resources acquired by Eagle Profiler
169
+ */
170
+ release(): Promise<void>;
171
+ private static _initProfilerWasm;
172
+ }
173
+ /**
174
+ * JavaScript/WebAssembly binding for Eagle Speaker Recognition engine.
175
+ * It processes incoming audio in consecutive frames and emits a similarity score for each enrolled speaker.
176
+ */
177
+ export declare class Eagle extends EagleBase {
178
+ private readonly _pv_eagle_process;
179
+ private readonly _pv_eagle_scores_delete;
180
+ private readonly _pv_eagle_delete;
181
+ private readonly _objectAddress;
182
+ private readonly _scoresAddressAddress;
183
+ private readonly _minProcessSamples;
184
+ private constructor();
185
+ /**
186
+ * Number of audio samples per frame expected by Eagle (i.e. length of the array passed into `.process()`)
187
+ */
188
+ get minProcessSamples(): number;
189
+ /**
190
+ * Creates an instance of the Picovoice Eagle Speaker Recognition Engine.
191
+ *
192
+ * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
193
+ * @param model Eagle model options.
194
+ * @param model.base64 The model in base64 string to initialize Eagle.
195
+ * @param model.publicPath The model path relative to the public directory.
196
+ * @param model.customWritePath Custom path to save the model in storage.
197
+ * Set to a different name to use multiple models across `eagle` instances.
198
+ * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
199
+ * @param model.version Version of the model file. Increment to update the model file in storage.
200
+ * @param options Optional configuration arguments.
201
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
202
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
203
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
204
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
205
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
206
+ * @param options.voiceThreshold Sensitivity threshold for detecting voice.
207
+ *
208
+ * @return An instance of the Eagle engine.
209
+ */
210
+ static create(accessKey: string, model: EagleModel, options?: EagleOptions): Promise<Eagle>;
211
+ static _init(accessKey: string, modelPath: string, options?: EagleOptions): Promise<Eagle>;
212
+ /**
213
+ * Processes audio and returns a list of similarity scores for each speaker profile.
214
+ *
215
+ * @param pcm Array of audio samples. The minimum number of samples per frame can be attained by calling
216
+ * `.minProcessSamples`. The incoming audio needs to have a sample rate equal to `.sampleRate` and be 16-bit
217
+ * linearly-encoded. Eagle operates on single-channel audio.
218
+ * @param speakerProfiles One or more Eagle speaker profiles. These can be constructed using `EagleProfiler`.
219
+ *
220
+ * @return A list of similarity scores for each speaker profile. A higher score indicates that the voice
221
+ * belongs to the corresponding speaker. The range is [0, 1] with 1.0 representing a perfect match.
222
+ */
223
+ process(pcm: Int16Array, speakerProfiles: EagleProfile[] | EagleProfile): Promise<number[] | null>;
224
+ /**
225
+ * Releases resources acquired by Eagle
226
+ */
227
+ release(): Promise<void>;
228
+ /**
229
+ * Lists all available devices that Eagle can use for inference.
230
+ * Each entry in the list can be the used as the `device` argument for the `.create` method.
231
+ *
232
+ * @returns List of all available devices that Eagle can use for inference.
233
+ */
234
+ static listAvailableDevices(): Promise<string[]>;
235
+ private static _initWasm;
236
+ }
237
+ export {};
201
238
  //# sourceMappingURL=eagle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eagle.d.ts","sourceRoot":"","sources":["../../src/eagle.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,YAAY,EAKZ,OAAO,EACR,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAmDjB,KAAK,wBAAwB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEpE,KAAK,uBAAuB,GAAG,CAC7B,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,MAAM,KACtB,OAAO,CAAC,MAAM,CAAC,CAAC;AACrB,KAAK,wBAAwB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,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BAAa,KAAM,SAAQ,SAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAC1D,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAA8B;IACtE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IAExD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAE/C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAE5C,OAAO;IAaP;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;WACiB,MAAM,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,KAAK,CAAC;WAaG,KAAK,CACvB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,KAAK,CAAC;IAqDjB;;;;;;;;;;OAUG;IACU,OAAO,CAClB,GAAG,EAAE,UAAU,EACf,eAAe,EAAE,YAAY,EAAE,GAAG,YAAY,GAC7C,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;IA0H3B;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrC;;;;;OAKG;WACiB,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;mBAqHxC,SAAS;CA2K/B"}
@@ -1,48 +1,48 @@
1
- import { PvError } from '@picovoice/web-utils';
2
- import { PvStatus } from './types';
3
- declare class EagleError extends Error {
4
- private readonly _status;
5
- private readonly _shortMessage;
6
- private readonly _messageStack;
7
- constructor(status: PvStatus, message: string, messageStack?: string[], pvError?: PvError | null);
8
- get status(): PvStatus;
9
- get shortMessage(): string;
10
- get messageStack(): string[];
11
- private static errorToString;
12
- }
13
- declare class EagleOutOfMemoryError extends EagleError {
14
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
15
- }
16
- declare class EagleIOError extends EagleError {
17
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
18
- }
19
- declare class EagleInvalidArgumentError extends EagleError {
20
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
21
- }
22
- declare class EagleStopIterationError extends EagleError {
23
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
24
- }
25
- declare class EagleKeyError extends EagleError {
26
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
27
- }
28
- declare class EagleInvalidStateError extends EagleError {
29
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
30
- }
31
- declare class EagleRuntimeError extends EagleError {
32
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
33
- }
34
- declare class EagleActivationError extends EagleError {
35
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
36
- }
37
- declare class EagleActivationLimitReachedError extends EagleError {
38
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
39
- }
40
- declare class EagleActivationThrottledError extends EagleError {
41
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
42
- }
43
- declare class EagleActivationRefusedError extends EagleError {
44
- constructor(message: string, messageStack?: string[], pvError?: PvError | null);
45
- }
46
- export { EagleError, EagleOutOfMemoryError, EagleIOError, EagleInvalidArgumentError, EagleStopIterationError, EagleKeyError, EagleInvalidStateError, EagleRuntimeError, EagleActivationError, EagleActivationLimitReachedError, EagleActivationThrottledError, EagleActivationRefusedError, };
47
- export declare function pvStatusToException(pvStatus: PvStatus, errorMessage: string, messageStack?: string[], pvError?: PvError | null): EagleError;
1
+ import { PvError } from '@picovoice/web-utils';
2
+ import { PvStatus } from './types';
3
+ declare class EagleError extends Error {
4
+ private readonly _status;
5
+ private readonly _shortMessage;
6
+ private readonly _messageStack;
7
+ constructor(status: PvStatus, message: string, messageStack?: string[], pvError?: PvError | null);
8
+ get status(): PvStatus;
9
+ get shortMessage(): string;
10
+ get messageStack(): string[];
11
+ private static errorToString;
12
+ }
13
+ declare class EagleOutOfMemoryError extends EagleError {
14
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
15
+ }
16
+ declare class EagleIOError extends EagleError {
17
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
18
+ }
19
+ declare class EagleInvalidArgumentError extends EagleError {
20
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
21
+ }
22
+ declare class EagleStopIterationError extends EagleError {
23
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
24
+ }
25
+ declare class EagleKeyError extends EagleError {
26
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
27
+ }
28
+ declare class EagleInvalidStateError extends EagleError {
29
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
30
+ }
31
+ declare class EagleRuntimeError extends EagleError {
32
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
33
+ }
34
+ declare class EagleActivationError extends EagleError {
35
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
36
+ }
37
+ declare class EagleActivationLimitReachedError extends EagleError {
38
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
39
+ }
40
+ declare class EagleActivationThrottledError extends EagleError {
41
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
42
+ }
43
+ declare class EagleActivationRefusedError extends EagleError {
44
+ constructor(message: string, messageStack?: string[], pvError?: PvError | null);
45
+ }
46
+ export { EagleError, EagleOutOfMemoryError, EagleIOError, EagleInvalidArgumentError, EagleStopIterationError, EagleKeyError, EagleInvalidStateError, EagleRuntimeError, EagleActivationError, EagleActivationLimitReachedError, EagleActivationThrottledError, EagleActivationRefusedError, };
47
+ export declare function pvStatusToException(pvStatus: PvStatus, errorMessage: string, messageStack?: string[], pvError?: PvError | null): EagleError;
48
48
  //# sourceMappingURL=eagle_errors.d.ts.map