From 6ba6da8d09ea53893b9298de8925c4d65badadb3 Mon Sep 17 00:00:00 2001 From: Ali <83210137+alielbekov@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:01:58 -0800 Subject: [PATCH] Update API doc (#182) * update and fix docs * fix typo * update docs, add default values and add stream to VAD options --- docs/css/custom-overrides.css | 6 ++ docs/user-guide/algorithm.md | 12 +-- docs/user-guide/api.md | 144 ++++++++++++++++--------------- mkdocs.yml | 2 + packages/react/package-lock.json | 97 +++++++++++++-------- packages/web/package-lock.json | 61 ++++++++----- 6 files changed, 187 insertions(+), 135 deletions(-) create mode 100644 docs/css/custom-overrides.css diff --git a/docs/css/custom-overrides.css b/docs/css/custom-overrides.css new file mode 100644 index 0000000..9b0ab29 --- /dev/null +++ b/docs/css/custom-overrides.css @@ -0,0 +1,6 @@ +.md-typeset table td:nth-child(1) code, +.md-typeset table th:nth-child(1) code, +.md-typeset table td:nth-child(2) code, +.md-typeset table th:nth-child(2) code { + word-break: normal; +} \ No newline at end of file diff --git a/docs/user-guide/algorithm.md b/docs/user-guide/algorithm.md index d90bef7..d093dfb 100644 --- a/docs/user-guide/algorithm.md +++ b/docs/user-guide/algorithm.md @@ -13,9 +13,9 @@ The VAD algorithm works as follows: All of the main APIs accept certain common configuration parameters that modify the VAD algorithm. -* `positiveSpeechThreshold: number` - determines the threshold over which a probability is considered to indicate the presence of speech. -* `negativeSpeechThreshold: number` - determines the threshold under which a probability is considered to indicate the absence of speech. -* `redemptionFrames: number` - number of speech-negative frames to wait before ending a speech segment. -* `frameSamples: number` - the size of a frame in samples. For the older (default) Silero model, this should probably be 1536. For the new, Silero version 5 model, it should be 512. -* `preSpeechPadFrames: number` - number of audio frames to prepend to a speech segment. -* `minSpeechFrames: number` - minimum number of speech-positive frames for a speech segment. +* `positiveSpeechThreshold: number` - determines the threshold over which a probability is considered to indicate the presence of speech. default: `0.5` +* `negativeSpeechThreshold: number` - determines the threshold under which a probability is considered to indicate the absence of speech. default: `0.35` +* `redemptionFrames: number` - number of speech-negative frames to wait before ending a speech segment. default: `8` +* `frameSamples: number` - the size of a frame in samples. For the older (default) Silero model, this should probably be 1536. For the new, Silero version 5 model, it should be 512. default: `1536` +* `preSpeechPadFrames: number` - number of audio frames to prepend to a speech segment. default: `1` +* `minSpeechFrames: number` - minimum number of speech-positive frames for a speech segment. default: `3` diff --git a/docs/user-guide/api.md b/docs/user-guide/api.md index 9229e27..ee69fe1 100644 --- a/docs/user-guide/api.md +++ b/docs/user-guide/api.md @@ -6,10 +6,10 @@ The `MicVAD` API is for recording user audio in the browser and running callbacks on speech segments and related events. ### Support -| Package | Supported | -| ---------------------- | ---------------------------------------------- | -| `@ricky0123/vad-web` | Yes | -| `@ricky0123/vad-react` | No, use the [useMicVAD](api.md#usemicvad) hook | +| Package | Type | Supported | Description | +| ---------------------- | ---------- | ---------------------------------------------- | ----------- | +| `@ricky0123/vad-web` | `package` | Yes | | +| `@ricky0123/vad-react` | `package` | No, use the [useMicVAD](api.md#usemicvad) hook | | ### Example ```js linenums="1" @@ -25,40 +25,42 @@ myvad.start() ### Options New instances of `MicVAD` are created by calling the async static method `MicVAD.new(options)`. The options object can contain the following fields (all are optional). -| Option | Type | Description | -| ----------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `additionalAudioConstraints` | `Partial` | Additional [constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) to pass to [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) via the `audio` field. Note that some constraints (channelCount, echoCancellation, autoGainControl, noiseSuppression) are set by default. | -| `onFrameProcessed` | `(probabilities: {isSpeech: float; notSpeech: float}, frame: Float32Array) => any` | Callback to run after each frame. The frame parameter contains the raw audio data for that frame. | -| `onVADMisfire` | `() => any` | Callback to run if speech start was detected but `onSpeechEnd` will not be run because the audio segment is smaller than `minSpeechFrames` | -| `onSpeechStart` | `() => any` | Callback to run when speech start is detected | -| `onSpeechRealStart` | `() => any` | Callback to run when actual speech positive frames exceeds min speech frames threshold is detected | -| `onSpeechEnd` | `(audio: Float32Array) => any` | Callback to run when speech end is detected. Takes as arg a Float32Array of audio samples between -1 and 1, sample rate 16000. This will not run if the audio segment is smaller than `minSpeechFrames` | -| `positiveSpeechThreshold` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `negativeSpeechThreshold` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `redemptionFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `frameSamples` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `preSpeechPadFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `minSpeechFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `model` | `"v5" or "legacy"` (default `"legacy"`) | whether to use the new Silero model or not | -| `baseAssetPath` | `string`) | URL or path relative to webroot where `vad.worklet.bundle.min.js`, `silero_vad_legacy.onnx`, and `silero_vad_v5.onnx` will be loaded from | -| `onnxWASMBasePath` | `string`) | URL or path relative to webroot where wasm files for onnxruntime-web will be loaded from | +| Option | Type | Default | Description | +| ----------------------------- | ------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalAudioConstraints` | `Partial` | `{}` | Additional [constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) to pass to [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) via the `audio` field. Note that some constraints (channelCount, echoCancellation, autoGainControl, noiseSuppression) are set by default. | +| `onFrameProcessed` | `(probabilities: {isSpeech: float; notSpeech: float}, frame: Float32Array) => any` | `() => {}` | Callback to run after each frame. The frame parameter contains the raw audio data for that frame. | +| `onVADMisfire` | `() => any` | `() => {}` | Callback to run if speech start was detected but `onSpeechEnd` will not be run because the audio segment is smaller than `minSpeechFrames` | +| `onSpeechStart` | `() => any` | `() => {}` | Callback to run when speech start is detected | +| `onSpeechRealStart` | `() => any` | `() => {}` | Callback to run when actual speech positive frames exceeds min speech frames threshold is detected | +| `onSpeechEnd` | `(audio: Float32Array) => any` | `() => {}` | Callback to run when speech end is detected. Takes as arg a Float32Array of audio samples between -1 and 1, sample rate 16000. This will not run if the audio segment is smaller than `minSpeechFrames` | +| `positiveSpeechThreshold` | `number` | `0.5` | [see algorithm configuration](algorithm.md#configuration) | +| `negativeSpeechThreshold` | `number` | `0.35` | [see algorithm configuration](algorithm.md#configuration) | +| `redemptionFrames` | `number` | `8` | [see algorithm configuration](algorithm.md#configuration) | +| `frameSamples` | `number` | `1536` | [see algorithm configuration](algorithm.md#configuration) | +| `preSpeechPadFrames` | `number` | `1` | [see algorithm configuration](algorithm.md#configuration) | +| `minSpeechFrames` | `number` | `3` | [see algorithm configuration](algorithm.md#configuration) | +| `model` | `"v5" or "legacy"` | `"legacy"` | whether to use the new Silero model or not | +| `baseAssetPath` | `string` | `/` | URL or path relative to webroot where `vad.worklet.bundle.min.js`, `silero_vad_legacy.onnx`, and `silero_vad_v5.onnx` will be loaded from | +| `onnxWASMBasePath` | `string` | `/` | URL or path relative to webroot where wasm files for onnxruntime-web will be loaded from | +| `stream` | `MediaStream` | `undefined` | Optional media stream to use instead of creating a new one. If not provided, the VAD will create its own stream using getUserMedia. | +| `workletOptions` | `AudioWorkletNodeOptions` | `{}` | Options to pass to the [AudioWorkletNode constructor](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/AudioWorkletNode#options). | ### Attributes -| Attributes | Type | Description | -| ----------- | ------------ | -------------------------------------------------- | -| `listening` | `boolean` | Is the VAD listening to mic input or is it paused? | -| `pause` | `() => void` | Stop listening to mic input | -| `start` | `() => void` | Start listening to mic input | +| Attributes | Type | Default | Description | +| ----------- | ------------ | ------- | -------------------------------------------------- | +| `listening` | `boolean` | `false` | Is the VAD listening to mic input or is it paused? | +| `pause` | `() => void` | | Stop listening to mic input | +| `start` | `() => void` | | Start listening to mic input | ## NonRealTimeVAD The `NonRealTimeVAD` API is for identifying segments of user speech if you already have a Float32Array of audio samples. ### Support -| Package | Supported | -| ---------------------- | --------- | -| `@ricky0123/vad-web` | Yes | -| `@ricky0123/vad-react` | No | +| Package | Type | Supported | Description | +| ---------------------- | ---------- | --------- | ----------- | +| `@ricky0123/vad-web` | `package` | Yes | | +| `@ricky0123/vad-react` | `package` | No | | ### Example ```js linenums="1" @@ -78,29 +80,29 @@ for await (const {audio, start, end} of myvad.run(audioFileData, nativeSampleRat ### Options New instances of `MicVAD` are created by calling the async static method `MicVAD.new(options)`. The options object can contain the following fields (all are optional). -| Option | Type | Description | -| ------------------------- | -------- | --------------------------------------------------------- | -| `positiveSpeechThreshold` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `negativeSpeechThreshold` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `redemptionFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `frameSamples` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `preSpeechPadFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `minSpeechFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | +| Option | Type | Default | Description | +| ------------------------- | -------- | ------- | --------------------------------------------------------- | +| `positiveSpeechThreshold` | `number` | `0.5` | [see algorithm configuration](algorithm.md#configuration) | +| `negativeSpeechThreshold` | `number` | `0.35` | [see algorithm configuration](algorithm.md#configuration) | +| `redemptionFrames` | `number` | `8` | [see algorithm configuration](algorithm.md#configuration) | +| `frameSamples` | `number` | `1536` | [see algorithm configuration](algorithm.md#configuration) | +| `preSpeechPadFrames` | `number` | `1` | [see algorithm configuration](algorithm.md#configuration) | +| `minSpeechFrames` | `number` | `3` | [see algorithm configuration](algorithm.md#configuration) | ### Attributes -| Attributes | Type | Description | -| ----------- | -------------------------------------------------------------------------------- | ------------------------------- | -| `run` | `async function* (inputAudio: Float32Array, sampleRate: number): AsyncGenerator` | Run the VAD model on your audio | +| Attributes | Type | Default | Description | +| ----------- | -------------------------------------------------------------------------------- | ------- | ------------------------------- | +| `run` | `async function* (inputAudio: Float32Array, sampleRate: number): AsyncGenerator` | | Run the VAD model on your audio | ## useMicVAD A React hook wrapper for [MicVAD](api.md#micvad). Use this if you want to run the VAD model on mic input in a React application. ### Support -| Package | Supported | -| ---------------------- | ------------------------------- | -| `@ricky0123/vad-web` | No, use [MicVAD](api.md#micvad) | -| `@ricky0123/vad-react` | Yes | +| Package | Type | Supported | Description | +| ---------------------- | ---------- | ------------------------------- | ----------- | +| `@ricky0123/vad-web` | `package` | No, use [MicVAD](api.md#micvad) | | +| `@ricky0123/vad-react` | `package` | Yes | | ### Example ```js linenums="1" @@ -110,37 +112,37 @@ const MyComponent = () => { const vad = useMicVAD({ startOnLoad: true, onSpeechEnd: (audio) => { - console.log("User stopped talking") + console.log("User stopped speaking") }, }) - return
{vad.userSpeaking && "User is speaking"}
+ return
User speaking: {vad.userSpeaking}
} ``` ### Options -The `useMicVAD` hook takes an options object with the following fields (all optional). - -| Option | Type | Description | -| ----------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `startOnLoad` | `boolean` | Should the VAD start listening to mic input when it finishes loading? | -| `additionalAudioConstraints` | `Partial` | Additional [constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) to pass to [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) via the `audio` field. Note that some constraints (channelCount, echoCancellation, autoGainControl, noiseSuppression) are set by default. | -| `onFrameProcessed` | `(probabilities: {isSpeech: float; notSpeech: float}, frame: Float32Array) => any` | Callback to run after each frame. The frame parameter contains the raw audio data for that frame. | -| `onVADMisfire` | `() => any` | Callback to run if speech start was detected but `onSpeechEnd` will not be run because the audio segment is smaller than `minSpeechFrames` | -| `onSpeechStart` | `() => any` | Callback to run when speech start is detected | -| `onSpeechEnd` | `(audio: Float32Array) => any` | Callback to run when speech end is detected. Takes as arg a Float32Array of audio samples between -1 and 1, sample rate 16000. This will not run if the audio segment is smaller than `minSpeechFrames` | -| `positiveSpeechThreshold` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `negativeSpeechThreshold` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `redemptionFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `frameSamples` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `preSpeechPadFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | -| `minSpeechFrames` | `number` | [see algorithm configuration](algorithm.md#configuration) | +The `useMicVAD` hook takes an options object with the following fields (all are optional). + +| Option | Type | Default | Description | +| ----------------------------- | ------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startOnLoad` | `boolean` | `true` | Whether to start the VAD automatically when the component loads. | +| `additionalAudioConstraints` | `Partial` | `{}` | Additional [constraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) to pass to [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) via the `audio` field. Note that some constraints (channelCount, echoCancellation, autoGainControl, noiseSuppression) are set by default. | +| `onFrameProcessed` | `(probabilities: {isSpeech: float; notSpeech: float}, frame: Float32Array) => any` | `() => {}` | Callback to run after each frame. The frame parameter contains the raw audio data for that frame. | +| `onVADMisfire` | `() => any` | `() => {}` | Callback to run if speech start was detected but `onSpeechEnd` will not be run because the audio segment is smaller than `minSpeechFrames` | +| `onSpeechStart` | `() => any` | `() => {}` | Callback to run when speech start is detected | +| `onSpeechEnd` | `(audio: Float32Array) => any` | `() => {}` | Callback to run when speech end is detected. Takes as arg a Float32Array of audio samples between -1 and 1, sample rate 16000. This will not run if the audio segment is smaller than `minSpeechFrames` | +| `positiveSpeechThreshold` | `number` | `0.5` | [see algorithm configuration](algorithm.md#configuration) | +| `negativeSpeechThreshold` | `number` | `0.35` | [see algorithm configuration](algorithm.md#configuration) | +| `redemptionFrames` | `number` | `8` | [see algorithm configuration](algorithm.md#configuration) | +| `frameSamples` | `number` | `1536` | [see algorithm configuration](algorithm.md#configuration) | +| `preSpeechPadFrames` | `number` | `1` | [see algorithm configuration](algorithm.md#configuration) | +| `minSpeechFrames` | `number` | `3` | [see algorithm configuration](algorithm.md#configuration) | ### Returns -| Attributes | Type | Description | -| -------------- | ------------------------------- | -------------------------------------------- | -| `listening` | `boolean` | Is the VAD currently listening to mic input? | -| `errored` | `false \| { message: string; }` | Did the VAD fail to load? | -| `loading` | `boolean` | Did the VAD finish loading? | -| `userSpeaking` | `boolean` | Is the user speaking? | -| `pause` | `() => void` | Stop the VAD from running on mic input | -| `start` | `() => void` | Start running the VAD on mic input | +| Attributes | Type | Default | Description | +| -------------- | ------------------------------- | ------- | -------------------------------------------- | +| `listening` | `boolean` | `false` | Is the VAD currently listening to mic input? | +| `errored` | `false or { message: string}` | | Did the VAD fail to load? | +| `loading` | `boolean` | `true` | Did the VAD finish loading? | +| `userSpeaking` | `boolean` | `false` | Is the user speaking? | +| `pause` | `() => void` | | Stop the VAD from running on mic input | +| `start` | `() => void` | | Start the VAD running on mic input | diff --git a/mkdocs.yml b/mkdocs.yml index 6c4d977..e080e13 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -44,3 +44,5 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences +extra_css: + - css/custom-overrides.css diff --git a/packages/react/package-lock.json b/packages/react/package-lock.json index 1eab1a2..a389da2 100644 --- a/packages/react/package-lock.json +++ b/packages/react/package-lock.json @@ -1,23 +1,23 @@ { "name": "@ricky0123/vad-react", - "version": "0.0.27", + "version": "0.0.28", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ricky0123/vad-react", - "version": "0.0.27", + "version": "0.0.28", "license": "ISC", "dependencies": { - "@ricky0123/vad-web": "^0.0.21", - "onnxruntime-web": "^1.14.0" + "@ricky0123/vad-web": "0.0.22", + "onnxruntime-web": "1.14.0" }, "devDependencies": { - "@types/react": "^18.0.28" + "@types/react": "18.0.28" }, "peerDependencies": { - "react": "^18", - "react-dom": "^18" + "react": "18", + "react-dom": "18" } }, "node_modules/@protobufjs/aspromise": { @@ -85,18 +85,24 @@ "license": "BSD-3-Clause" }, "node_modules/@ricky0123/vad-web": { - "version": "0.0.21", - "resolved": "https://registry.npmjs.org/@ricky0123/vad-web/-/vad-web-0.0.21.tgz", - "integrity": "sha512-zsCELv/q+Uaf21eVImspdkjuLAPuQd1y+VS5rohzcqxVg162NVDqbEibl2oyqj82xq5Hwgq32Ta5+X5Z/K61BQ==", + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/@ricky0123/vad-web/-/vad-web-0.0.22.tgz", + "integrity": "sha512-679R6sfwXx4jkquK+FJ9RC2W29oulWC+9ZINK6LVpuy90IBV7UaTGNN79oQXufpJTJs5z4X/22nw1DQ4+Rh8CA==", "license": "ISC", "dependencies": { - "onnxruntime-web": "^1.14.0" + "onnxruntime-web": "1.14.0" } }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, "node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "version": "22.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", + "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", "license": "MIT", "dependencies": { "undici-types": "~6.20.0" @@ -110,16 +116,24 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.14.tgz", - "integrity": "sha512-NzahNKvjNhVjuPBQ+2G7WlxstQ+47kXZNHlUvFakDViuIEfGY926GqhMueQFZ7woG+sPiQKlF36XfrIUVSUfFg==", + "version": "18.0.28", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz", + "integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==", "dev": true, "license": "MIT", "dependencies": { "@types/prop-types": "*", + "@types/scheduler": "*", "csstype": "^3.0.2" } }, + "node_modules/@types/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==", + "dev": true, + "license": "MIT" + }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -147,9 +161,9 @@ "peer": true }, "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", "license": "Apache-2.0" }, "node_modules/loose-envify": { @@ -165,24 +179,33 @@ "loose-envify": "cli.js" } }, + "node_modules/onnx-proto": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/onnx-proto/-/onnx-proto-4.0.4.tgz", + "integrity": "sha512-aldMOB3HRoo6q/phyB6QRQxSt895HNNw82BNyZ2CMh4bjeKv7g/c+VpAFtJuEMVfYLMbRx61hbuqnKceLeDcDA==", + "license": "MIT", + "dependencies": { + "protobufjs": "^6.8.8" + } + }, "node_modules/onnxruntime-common": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.20.1.tgz", - "integrity": "sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.14.0.tgz", + "integrity": "sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew==", "license": "MIT" }, "node_modules/onnxruntime-web": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.20.1.tgz", - "integrity": "sha512-TePF6XVpLL1rWVMIl5Y9ACBQcyCNFThZON/jgElNd9Txb73CIEGlklhYR3UEr1cp5r0rbGI6nDwwrs79g7WjoA==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.14.0.tgz", + "integrity": "sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==", "license": "MIT", "dependencies": { "flatbuffers": "^1.12.0", "guid-typescript": "^1.0.9", - "long": "^5.2.3", - "onnxruntime-common": "1.20.1", - "platform": "^1.3.6", - "protobufjs": "^7.2.4" + "long": "^4.0.0", + "onnx-proto": "^4.0.4", + "onnxruntime-common": "~1.14.0", + "platform": "^1.3.6" } }, "node_modules/platform": { @@ -192,9 +215,9 @@ "license": "MIT" }, "node_modules/protobufjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", - "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -208,11 +231,13 @@ "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", "@types/node": ">=13.7.0", - "long": "^5.0.0" + "long": "^4.0.0" }, - "engines": { - "node": ">=12.0.0" + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" } }, "node_modules/react": { diff --git a/packages/web/package-lock.json b/packages/web/package-lock.json index b11e93a..b4e2600 100644 --- a/packages/web/package-lock.json +++ b/packages/web/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ricky0123/vad-web", - "version": "0.0.21", + "version": "0.0.22", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ricky0123/vad-web", - "version": "0.0.21", + "version": "0.0.22", "license": "ISC", "dependencies": { - "onnxruntime-web": "^1.14.0" + "onnxruntime-web": "1.14.0" }, "devDependencies": { "@types/audioworklet": "^0.0.36", @@ -254,6 +254,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -1480,9 +1486,9 @@ } }, "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", "license": "Apache-2.0" }, "node_modules/media-typer": { @@ -1615,24 +1621,33 @@ "node": ">= 0.8" } }, + "node_modules/onnx-proto": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/onnx-proto/-/onnx-proto-4.0.4.tgz", + "integrity": "sha512-aldMOB3HRoo6q/phyB6QRQxSt895HNNw82BNyZ2CMh4bjeKv7g/c+VpAFtJuEMVfYLMbRx61hbuqnKceLeDcDA==", + "license": "MIT", + "dependencies": { + "protobufjs": "^6.8.8" + } + }, "node_modules/onnxruntime-common": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.20.1.tgz", - "integrity": "sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.14.0.tgz", + "integrity": "sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew==", "license": "MIT" }, "node_modules/onnxruntime-web": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.20.1.tgz", - "integrity": "sha512-TePF6XVpLL1rWVMIl5Y9ACBQcyCNFThZON/jgElNd9Txb73CIEGlklhYR3UEr1cp5r0rbGI6nDwwrs79g7WjoA==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.14.0.tgz", + "integrity": "sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==", "license": "MIT", "dependencies": { "flatbuffers": "^1.12.0", "guid-typescript": "^1.0.9", - "long": "^5.2.3", - "onnxruntime-common": "1.20.1", - "platform": "^1.3.6", - "protobufjs": "^7.2.4" + "long": "^4.0.0", + "onnx-proto": "^4.0.4", + "onnxruntime-common": "~1.14.0", + "platform": "^1.3.6" } }, "node_modules/p-limit": { @@ -1745,9 +1760,9 @@ "license": "MIT" }, "node_modules/protobufjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", - "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -1761,11 +1776,13 @@ "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", "@types/node": ">=13.7.0", - "long": "^5.0.0" + "long": "^4.0.0" }, - "engines": { - "node": ">=12.0.0" + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" } }, "node_modules/proxy-addr": {