@picovoice/eagle-web 1.0.0 → 2.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,40 +1,54 @@
1
+ /// <reference types="emscripten" />
1
2
  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>;
3
+ import { EagleModel, EagleOptions, EagleProfile, EagleProfilerEnrollResult, EagleProfilerOptions } from './types';
4
+ type pv_eagle_profiler_enroll_min_audio_length_samples_type = (object: number, numSamples: number) => 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_frame_length_type = () => 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_enroll_min_audio_length_samples: pv_eagle_profiler_enroll_min_audio_length_samples_type;
18
+ _pv_eagle_profiler_export: pv_eagle_profiler_export_type;
19
+ _pv_eagle_profiler_export_size: pv_eagle_profiler_export_size_type;
20
+ _pv_eagle_frame_length: pv_eagle_frame_length_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
+ };
7
32
  type EagleBaseWasmOutput = {
8
- memory: WebAssembly.Memory;
9
- alignedAlloc: aligned_alloc_type;
10
- pvFree: pv_free_type;
11
- pvError: PvError;
33
+ module: EagleModule;
12
34
  sampleRate: number;
13
35
  version: string;
14
36
  messageStackAddressAddressAddress: number;
15
37
  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
38
  };
21
39
  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;
40
+ protected _module?: EagleModule;
26
41
  protected readonly _functionMutex: Mutex;
27
- protected readonly _pvGetErrorStack: pv_get_error_stack_type;
28
- protected readonly _pvFreeErrorStack: pv_free_error_stack_type;
29
42
  protected readonly _messageStackAddressAddressAddress: number;
30
43
  protected readonly _messageStackDepthAddress: number;
31
- protected static _sampleRate: number;
32
- protected static _version: string;
33
- protected static _wasm: string;
44
+ protected readonly _sampleRate: number;
45
+ protected readonly _version: string;
34
46
  protected static _wasmSimd: string;
47
+ protected static _wasmSimdLib: string;
48
+ protected static _wasmPThread: string;
49
+ protected static _wasmPThreadLib: string;
35
50
  protected static _sdk: string;
36
51
  protected static _eagleMutex: Mutex;
37
- protected readonly _pvError: PvError;
38
52
  protected constructor(handleWasm: EagleBaseWasmOutput);
39
53
  /**
40
54
  * Audio sample rate required by Eagle.
@@ -44,37 +58,49 @@ declare class EagleBase {
44
58
  * Version of Eagle.
45
59
  */
46
60
  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
61
  /**
53
62
  * Set base64 wasm file with SIMD feature.
54
63
  * @param wasmSimd Base64'd wasm file to use to initialize wasm.
55
64
  */
56
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;
57
81
  static setSdk(sdk: string): void;
58
- protected static _initBaseWasm(wasmBase64: string, wasmMemorySize: number): Promise<EagleBaseWasmOutput>;
82
+ protected static _initBaseWasm(wasmBase64: string, wasmLibBase64: string, createModuleFunc: any): Promise<EagleBaseWasmOutput>;
59
83
  /**
60
84
  * Releases resources acquired by Eagle
61
85
  */
62
86
  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[]>;
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;
64
89
  }
65
90
  /**
66
91
  * JavaScript/WebAssembly binding for the profiler of the Eagle Speaker Recognition engine.
67
92
  * It enrolls a speaker given a set of utterances and then constructs a profile for the enrolled speaker.
68
93
  */
69
94
  export declare class EagleProfiler extends EagleBase {
70
- private readonly _pvEagleProfilerDelete;
71
- private readonly _pvEagleProfilerEnroll;
72
- private readonly _pvEagleProfilerExport;
73
- private readonly _pvEagleProfilerReset;
95
+ private readonly _pv_eagle_profiler_enroll;
96
+ private readonly _pv_eagle_profiler_reset;
97
+ private readonly _pv_eagle_profiler_delete;
74
98
  private readonly _objectAddress;
75
- private static _maxEnrollSamples;
76
- private static _minEnrollSamples;
77
- private static _profileSize;
99
+ private readonly _feedbackAddress;
100
+ private readonly _percentageAddress;
101
+ private readonly _maxEnrollSamples;
102
+ private readonly _minEnrollSamples;
103
+ private readonly _profileSize;
78
104
  private constructor();
79
105
  /**
80
106
  * The minimum length of the input pcm required by `.enroll()`.
@@ -91,11 +117,17 @@ export declare class EagleProfiler extends EagleBase {
91
117
  * Set to a different name to use multiple models across `eagle` instances.
92
118
  * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
93
119
  * @param model.version Version of the model file. Increment to update the model file in storage.
120
+ * @param options Optional configuration arguments.
121
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
122
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
123
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
124
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
125
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
94
126
  *
95
127
  * @return An instance of the Eagle Profiler.
96
128
  */
97
- static create(accessKey: string, model: EagleModel): Promise<EagleProfiler>;
98
- static _init(accessKey: string, modelPath: string): Promise<EagleProfiler>;
129
+ static create(accessKey: string, model: EagleModel, options?: EagleProfilerOptions): Promise<EagleProfiler>;
130
+ static _init(accessKey: string, modelPath: string, options?: EagleProfilerOptions): Promise<EagleProfiler>;
99
131
  /**
100
132
  * Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker
101
133
  * until `percentage` reaches `100.0`, at which point a speaker voice profile can be exported using `.export()`.
@@ -145,13 +177,13 @@ export declare class EagleProfiler extends EagleBase {
145
177
  * It processes incoming audio in consecutive frames and emits a similarity score for each enrolled speaker.
146
178
  */
147
179
  export declare class Eagle extends EagleBase {
148
- private readonly _pvEagleDelete;
149
- private readonly _pvEagleProcess;
150
- private readonly _pvEagleReset;
180
+ private readonly _pv_eagle_process;
181
+ private readonly _pv_eagle_reset;
182
+ private readonly _pv_eagle_delete;
151
183
  private readonly _objectAddress;
152
184
  private readonly _scoresAddress;
185
+ private readonly _frameLength;
153
186
  private readonly _numSpeakers;
154
- private static _frameLength;
155
187
  private constructor();
156
188
  /**
157
189
  * Number of audio samples per frame expected by Eagle (i.e. length of the array passed into `.process()`)
@@ -169,11 +201,17 @@ export declare class Eagle extends EagleBase {
169
201
  * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
170
202
  * @param model.version Version of the model file. Increment to update the model file in storage.
171
203
  * @param speakerProfiles One or more Eagle speaker profiles. These can be constructed using `EagleProfiler`.
204
+ * @param options Optional configuration arguments.
205
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
206
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
207
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
208
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
209
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
172
210
  *
173
211
  * @return An instance of the Eagle engine.
174
212
  */
175
- static create(accessKey: string, model: EagleModel, speakerProfiles: EagleProfile[] | EagleProfile): Promise<Eagle>;
176
- static _init(accessKey: string, modelPath: string, speakerProfiles: EagleProfile[]): Promise<Eagle>;
213
+ static create(accessKey: string, model: EagleModel, speakerProfiles: EagleProfile[] | EagleProfile, options?: EagleOptions): Promise<Eagle>;
214
+ static _init(accessKey: string, modelPath: string, speakerProfiles: EagleProfile[], options?: EagleOptions): Promise<Eagle>;
177
215
  /**
178
216
  * Processes a frame of audio and returns a list of similarity scores for each speaker profile.
179
217
  *
@@ -195,6 +233,13 @@ export declare class Eagle extends EagleBase {
195
233
  * Releases resources acquired by Eagle
196
234
  */
197
235
  release(): Promise<void>;
236
+ /**
237
+ * Lists all available devices that Eagle can use for inference.
238
+ * Each entry in the list can be the used as the `device` argument for the `.create` method.
239
+ *
240
+ * @returns List of all available devices that Eagle can use for inference.
241
+ */
242
+ static listAvailableDevices(): Promise<string[]>;
198
243
  private static _initWasm;
199
244
  }
200
245
  export {};
@@ -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,CAAC,CAAC;AAExE,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;IAC3B,YAAY,EAAE,kBAAkB,CAAC;IACjC,MAAM,EAAE,YAAY,CAAC;I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ACtD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IAExD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,OAAO;IAcP;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;WACiB,MAAM,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,eAAe,EAAE,YAAY,EAAE,GAAG,YAAY,EAC9C,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,KAAK,CAAC;WAcG,KAAK,CACvB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,YAAY,EAAE,EAC/B,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,KAAK,CAAC;IAwDjB;;;;;;;;;OASG;IACU,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA2ExD;;;;OAIG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCnC;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrC;;;;;OAKG;WACiB,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;mBAqHxC,SAAS;CAuK/B"}
@@ -1,11 +1,13 @@
1
- import { EagleModel, EagleProfile, EagleProfilerEnrollResult } from './types';
1
+ import { EagleModel, EagleProfile, EagleProfilerEnrollResult, EagleProfilerOptions } from './types';
2
2
  export declare class EagleProfilerWorker {
3
3
  private readonly _worker;
4
4
  private readonly _minEnrollSamples;
5
5
  private readonly _sampleRate;
6
6
  private readonly _version;
7
- private static _wasm;
8
7
  private static _wasmSimd;
8
+ private static _wasmSimdLib;
9
+ private static _wasmPThread;
10
+ private static _wasmPThreadLib;
9
11
  private static _sdk;
10
12
  private constructor();
11
13
  /**
@@ -20,16 +22,26 @@ export declare class EagleProfilerWorker {
20
22
  * Version of Eagle.
21
23
  */
22
24
  get version(): string;
23
- /**
24
- * Set base64 wasm file.
25
- * @param wasm Base64'd wasm file to use to initialize wasm.
26
- */
27
- static setWasm(wasm: string): void;
28
25
  /**
29
26
  * Set base64 wasm file with SIMD feature.
30
- * @param wasmSimd Base64'd wasm file to use to initialize wasm.
27
+ * @param wasmSimd Base64'd wasm SIMD file to use to initialize wasm.
31
28
  */
32
29
  static setWasmSimd(wasmSimd: string): void;
30
+ /**
31
+ * Set base64 wasm file with SIMD feature in text format.
32
+ * @param wasmSimdLib Base64'd wasm SIMD file in text format.
33
+ */
34
+ static setWasmSimdLib(wasmSimdLib: string): void;
35
+ /**
36
+ * Set base64 wasm file with SIMD and pthread feature.
37
+ * @param wasmPThread Base64'd wasm file to use to initialize wasm.
38
+ */
39
+ static setWasmPThread(wasmPThread: string): void;
40
+ /**
41
+ * Set base64 SIMD and thread wasm file in text format.
42
+ * @param wasmPThreadLib Base64'd wasm file in text format.
43
+ */
44
+ static setWasmPThreadLib(wasmPThreadLib: string): void;
33
45
  static setSdk(sdk: string): void;
34
46
  /**
35
47
  * Creates an instance of profiler component of the Eagle Speaker Recognition Engine.
@@ -42,10 +54,16 @@ export declare class EagleProfilerWorker {
42
54
  * Set to a different name to use multiple models across `eagle` instances.
43
55
  * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
44
56
  * @param model.version Version of the model file. Increment to update the model file in storage.
57
+ * @param options Optional configuration arguments.
58
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
59
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
60
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
61
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
62
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
45
63
  *
46
64
  * @return An instance of the Eagle Profiler.
47
65
  */
48
- static create(accessKey: string, model: EagleModel): Promise<EagleProfilerWorker>;
66
+ static create(accessKey: string, model: EagleModel, options?: EagleProfilerOptions): Promise<EagleProfilerWorker>;
49
67
  /**
50
68
  * Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker
51
69
  * until `percentage` reaches `100.0`, at which point a speaker voice profile can be exported using `.export()`.
@@ -1 +1 @@
1
- {"version":3,"file":"eagle_profiler_worker.d.ts","sourceRoot":"","sources":["../../src/eagle_profiler_worker.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,yBAAyB,EAM1B,MAAM,SAAS,CAAC;AAIjB,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAS;IAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAS;IACjC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAiB;IAEpC,OAAO;IAYP;;OAEG;IACH,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;OAGG;WACW,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMzC;;;OAGG;WACW,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;WAMnC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIvC;;;;;;;;;;;;;OAaG;WACiB,MAAM,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,GAChB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AAI;IAMvD;;;OAGG;WACW,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAMvD;;;OAGG;WACW,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;WAM/C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIvC;;;;;;;;;;;;;;;;;;;OAmBG;WACiB,MAAM,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC;IA+D/B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAyClE;;;;;OAKG;IACU,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;IAuC5C;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCnC;;OAEG;IACI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC/B;;OAEG;IACI,SAAS,IAAI,IAAI;CAGzB"}
@@ -1,11 +1,13 @@
1
- import { EagleModel, EagleProfile } from './types';
1
+ import { EagleModel, EagleOptions, EagleProfile } from './types';
2
2
  export declare class EagleWorker {
3
3
  private readonly _worker;
4
4
  private readonly _frameLength;
5
5
  private readonly _sampleRate;
6
6
  private readonly _version;
7
- private static _wasm;
8
7
  private static _wasmSimd;
8
+ private static _wasmSimdLib;
9
+ private static _wasmPThread;
10
+ private static _wasmPThreadLib;
9
11
  private static _sdk;
10
12
  private constructor();
11
13
  /**
@@ -20,16 +22,26 @@ export declare class EagleWorker {
20
22
  * Version of Eagle.
21
23
  */
22
24
  get version(): string;
23
- /**
24
- * Set base64 wasm file.
25
- * @param wasm Base64'd wasm file to use to initialize wasm.
26
- */
27
- static setWasm(wasm: string): void;
28
25
  /**
29
26
  * Set base64 wasm file with SIMD feature.
30
- * @param wasmSimd Base64'd wasm file to use to initialize wasm.
27
+ * @param wasmSimd Base64'd wasm SIMD file to use to initialize wasm.
31
28
  */
32
29
  static setWasmSimd(wasmSimd: string): void;
30
+ /**
31
+ * Set base64 wasm file with SIMD feature in text format.
32
+ * @param wasmSimdLib Base64'd wasm SIMD file in text format.
33
+ */
34
+ static setWasmSimdLib(wasmSimdLib: string): void;
35
+ /**
36
+ * Set base64 wasm file with SIMD and pthread feature.
37
+ * @param wasmPThread Base64'd wasm file to use to initialize wasm.
38
+ */
39
+ static setWasmPThread(wasmPThread: string): void;
40
+ /**
41
+ * Set base64 SIMD and thread wasm file in text format.
42
+ * @param wasmPThreadLib Base64'd wasm file in text format.
43
+ */
44
+ static setWasmPThreadLib(wasmPThreadLib: string): void;
33
45
  static setSdk(sdk: string): void;
34
46
  /**
35
47
  * Creates an instance of the Picovoice Eagle Speaker Recognition Engine.
@@ -43,10 +55,16 @@ export declare class EagleWorker {
43
55
  * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
44
56
  * @param model.version Version of the model file. Increment to update the model file in storage.
45
57
  * @param speakerProfiles One or more Eagle speaker profiles. These can be constructed using `EagleProfiler`.
58
+ * @param options Optional configuration arguments.
59
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
60
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
61
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
62
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
63
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
46
64
  *
47
65
  * @return An instance of the Eagle engine.
48
66
  */
49
- static create(accessKey: string, model: EagleModel, speakerProfiles: EagleProfile[] | EagleProfile): Promise<EagleWorker>;
67
+ static create(accessKey: string, model: EagleModel, speakerProfiles: EagleProfile[] | EagleProfile, options?: EagleOptions): Promise<EagleWorker>;
50
68
  /**
51
69
  * Processes a frame of audio and returns a list of similarity scores for each speaker profile.
52
70
  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,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAsClD;;;;OAIG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCnC;;OAEG;IACI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC/B;;OAEG;IACI,SAAS,IAAI,IAAI;CAGzB"}
@@ -2,6 +2,6 @@ import { Eagle, EagleProfiler } from './eagle';
2
2
  import { EagleProfilerWorker } from './eagle_profiler_worker';
3
3
  import { EagleWorker } from './eagle_worker';
4
4
  import * as EagleErrors from './eagle_errors';
5
- import { EagleModel, EagleProfile, EagleProfilerEnrollFeedback, EagleProfilerEnrollResult, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse } from './types';
6
- export { Eagle, EagleErrors, EagleModel, EagleProfile, EagleProfiler, EagleProfilerEnrollFeedback, EagleProfilerEnrollResult, EagleProfilerWorker, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorker, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse, };
5
+ import { EagleModel, EagleOptions, EagleProfile, EagleProfilerEnrollFeedback, EagleProfilerEnrollResult, EagleProfilerOptions, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse } from './types';
6
+ export { Eagle, EagleErrors, EagleModel, EagleOptions, EagleProfile, EagleProfiler, EagleProfilerEnrollFeedback, EagleProfilerEnrollResult, EagleProfilerOptions, EagleProfilerWorker, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorker, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse, };
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,2BAA2B,EAC3B,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAcjB,OAAO,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,aAAa,EACb,2BAA2B,EAC3B,yBAAyB,EACzB,mBAAmB,EACnB,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,WAAW,EACX,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,0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B,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,GACpB,CAAC"}
@@ -28,6 +28,14 @@ export type EagleProfile = {
28
28
  /** Buffer containing the speaker profile. */
29
29
  bytes: Uint8Array;
30
30
  };
31
+ export type EagleOptions = {
32
+ /** @defaultValue `best` */
33
+ device?: string;
34
+ };
35
+ export type EagleProfilerOptions = {
36
+ /** @defaultValue `best` */
37
+ device?: string;
38
+ };
31
39
  export type EagleProfilerEnrollResult = {
32
40
  feedback: EagleProfilerEnrollFeedback;
33
41
  percentage: number;
@@ -36,8 +44,11 @@ export type EagleProfilerWorkerInitRequest = {
36
44
  command: 'init';
37
45
  accessKey: string;
38
46
  modelPath: string;
39
- wasm: string;
47
+ options: EagleProfilerOptions;
40
48
  wasmSimd: string;
49
+ wasmSimdLib: string;
50
+ wasmPThread: string;
51
+ wasmPThreadLib: string;
41
52
  sdk: string;
42
53
  };
43
54
  export type EagleProfilerWorkerEnrollRequest = {
@@ -86,8 +97,11 @@ export type EagleWorkerInitRequest = {
86
97
  accessKey: string;
87
98
  modelPath: string;
88
99
  speakerProfiles: EagleProfile[];
89
- wasm: string;
100
+ options: EagleOptions;
90
101
  wasmSimd: string;
102
+ wasmSimdLib: string;
103
+ wasmPThread: string;
104
+ wasmPThreadLib: string;
91
105
  sdk: string;
92
106
  };
93
107
  export type EagleWorkerProcessRequest = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,oBAAY,QAAQ;IAClB,OAAO,QAAQ;IACf,aAAa,QAAA;IACb,QAAQ,QAAA;IACR,gBAAgB,QAAA;IAChB,cAAc,QAAA;IACd,SAAS,QAAA;IACT,aAAa,QAAA;IACb,aAAa,QAAA;I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"}
package/module.d.ts CHANGED
@@ -3,6 +3,11 @@ declare module "*.wasm" {
3
3
  export default content;
4
4
  }
5
5
 
6
+ declare module "*.txt" {
7
+ const content: string;
8
+ export default content;
9
+ }
10
+
6
11
  declare module 'web-worker:*.ts' {
7
12
  const WorkerFactory: new () => Worker;
8
13
  export default WorkerFactory;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Eagle Speaker Recognition engine for web browsers (via WebAssembly)",
4
4
  "author": "Picovoice Inc",
5
5
  "license": "Apache-2.0",
6
- "version": "1.0.0",
6
+ "version": "2.0.0",
7
7
  "keywords": [
8
8
  "eagle",
9
9
  "web",
@@ -33,11 +33,11 @@
33
33
  "format": "prettier --write \"**/*.{js,ts,json}\"",
34
34
  "copywasm": "node scripts/copy_wasm.js",
35
35
  "setup-test": "node scripts/setup_test.js && npx pvbase64 -i ./test/eagle_params.pv -o ./test/eagle_params.js",
36
- "test": "cypress run --spec test/eagle.test.ts",
37
- "test-perf": "cypress run --spec test/eagle_perf.test.ts"
36
+ "test": "cypress run --spec test/eagle.test.ts --browser chrome",
37
+ "test-perf": "cypress run --spec test/eagle_perf.test.ts --browser chrome"
38
38
  },
39
39
  "dependencies": {
40
- "@picovoice/web-utils": "=1.3.2"
40
+ "@picovoice/web-utils": "=1.4.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/core": "^7.20.12",
@@ -49,6 +49,7 @@
49
49
  "@rollup/plugin-node-resolve": "^15.0.1",
50
50
  "@rollup/plugin-terser": "^0.4.0",
51
51
  "@rollup/pluginutils": "^5.0.2",
52
+ "@types/emscripten": "1.40.0",
52
53
  "@types/node": "^18.13.0",
53
54
  "@typescript-eslint/eslint-plugin": "^5.51.0",
54
55
  "@typescript-eslint/parser": "^5.51.0",
@@ -67,6 +68,6 @@
67
68
  "wasm-feature-detect": "^1.5.0"
68
69
  },
69
70
  "engines": {
70
- "node": ">=16"
71
+ "node": ">=18"
71
72
  }
72
73
  }
package/rollup.config.js CHANGED
@@ -69,7 +69,7 @@ export default {
69
69
  exclude: '**/node_modules/**',
70
70
  }),
71
71
  base64({
72
- include: ['./lib/**/*.wasm']
72
+ include: ['./src/lib/*.wasm', './src/lib/*.txt'],
73
73
  })
74
74
  ],
75
75
  };