@picovoice/eagle-web 0.2.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.
- package/README.md +20 -3
- package/dist/esm/index.js +14465 -1388
- package/dist/esm/index.min.js +1 -1
- package/dist/iife/index.js +14465 -1388
- package/dist/iife/index.min.js +1 -1
- package/dist/types/eagle.d.ts +90 -45
- package/dist/types/eagle.d.ts.map +1 -1
- package/dist/types/eagle_profiler_worker.d.ts +27 -9
- package/dist/types/eagle_profiler_worker.d.ts.map +1 -1
- package/dist/types/eagle_worker.d.ts +27 -9
- package/dist/types/eagle_worker.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +16 -2
- package/dist/types/types.d.ts.map +1 -1
- package/module.d.ts +5 -0
- package/package.json +6 -5
- package/rollup.config.js +1 -1
- package/src/eagle.ts +768 -451
- package/src/eagle_profiler_worker.ts +120 -30
- package/src/eagle_profiler_worker_handler.ts +9 -3
- package/src/eagle_worker.ts +106 -27
- package/src/eagle_worker_handler.ts +6 -3
- package/src/index.ts +21 -6
- package/src/types.ts +19 -3
- package/tsconfig.json +2 -2
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@ Eagle is an on-device speaker recognition engine. Eagle is:
|
|
|
8
8
|
|
|
9
9
|
- Private; All voice processing runs locally.
|
|
10
10
|
- Cross-Platform:
|
|
11
|
-
- Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64)
|
|
11
|
+
- Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64)
|
|
12
12
|
- Android and iOS
|
|
13
13
|
- Chrome, Safari, Firefox, and Edge
|
|
14
|
-
- Raspberry Pi (4,
|
|
14
|
+
- Raspberry Pi (3, 4, 5)
|
|
15
15
|
|
|
16
16
|
## Compatibility
|
|
17
17
|
|
|
@@ -19,11 +19,28 @@ Eagle is an on-device speaker recognition engine. Eagle is:
|
|
|
19
19
|
- Firefox
|
|
20
20
|
- Safari
|
|
21
21
|
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
The Eagle Web Binding uses [SharedArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer).
|
|
25
|
+
|
|
26
|
+
Include the following headers in the response to enable the use of `SharedArrayBuffers`:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Cross-Origin-Opener-Policy: same-origin
|
|
30
|
+
Cross-Origin-Embedder-Policy: require-corp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Refer to our [Web demo](../../demo/web) for an example on creating a server with the corresponding response headers.
|
|
34
|
+
|
|
35
|
+
Browsers that don't support `SharedArrayBuffers` or applications that don't include the required headers will fall back to using standard `ArrayBuffers`. This will disable multithreaded processing.
|
|
36
|
+
|
|
22
37
|
### Restrictions
|
|
23
38
|
|
|
24
39
|
IndexedDB is required to use `Eagle` in a worker thread. Browsers without IndexedDB support
|
|
25
40
|
(i.e. Firefox Incognito Mode) should use `Eagle` in the main thread.
|
|
26
41
|
|
|
42
|
+
Multi-threading is only enabled for Eagle when using on a web worker.
|
|
43
|
+
|
|
27
44
|
## Installation
|
|
28
45
|
|
|
29
46
|
Using `yarn`:
|
|
@@ -88,7 +105,7 @@ function getAudioData(numSamples): Int16Array {
|
|
|
88
105
|
let percentage = 0;
|
|
89
106
|
while (percentage < 100) {
|
|
90
107
|
const audioData = getAudioData(eagleProfiler.minEnrollSamples);
|
|
91
|
-
|
|
108
|
+
|
|
92
109
|
const result: EagleProfilerEnrollResult = await eagleProfiler.enroll(audioData);
|
|
93
110
|
if (result.feedback === EagleProfilerEnrollFeedback.AUDIO_OK) {
|
|
94
111
|
// audio is good!
|