@pexip/media-processor 22.0.0 → 22.2.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/CHANGELOG.md +41 -0
- package/api-docs/README.mdx +4 -1
- package/api-docs/functions/avg.mdx +1 -1
- package/api-docs/functions/createAnalyzerGraphNode.mdx +3 -1
- package/api-docs/functions/createAnalyzerSubscribableGraphNode.mdx +3 -1
- package/api-docs/functions/createAsyncCallbackLoop.mdx +6 -6
- package/api-docs/functions/createAudioDestinationGraphNode.mdx +1 -1
- package/api-docs/functions/createAudioSignalDetector.mdx +4 -4
- package/api-docs/functions/createAudioStats.mdx +1 -1
- package/api-docs/functions/createBenchmark.mdx +7 -6
- package/api-docs/functions/createChannelMergerGraphNode.mdx +1 -1
- package/api-docs/functions/createChannelSplitterGraphNode.mdx +1 -1
- package/api-docs/functions/createDelayGraphNode.mdx +1 -1
- package/api-docs/functions/createDenoiseWorkletGraphNode.mdx +2 -2
- package/api-docs/functions/createFrameCallbackRequest.mdx +3 -3
- package/api-docs/functions/createGainGraphNode.mdx +3 -1
- package/api-docs/functions/createMediaElementSourceGraphNode.mdx +1 -1
- package/api-docs/functions/createReadWritableStreamFallbackInputProcessAdaptor.mdx +1 -1
- package/api-docs/functions/createSegmenter.mdx +1 -1
- package/api-docs/functions/createStreamDestinationGraphNode.mdx +1 -1
- package/api-docs/functions/createStreamSourceGraphNode.mdx +1 -1
- package/api-docs/functions/createVADetector.mdx +3 -3
- package/api-docs/functions/createVoiceDetectorFromProbability.mdx +1 -1
- package/api-docs/functions/createVoiceDetectorFromTimeData.mdx +3 -1
- package/api-docs/functions/createWindowedStats.mdx +2 -2
- package/api-docs/functions/getBezierCurveControlPoints.mdx +3 -1
- package/api-docs/functions/labelComponents.mdx +3 -1
- package/api-docs/functions/loadScript.mdx +1 -1
- package/api-docs/functions/loadWasms.mdx +1 -1
- package/api-docs/functions/nearestPowerOfTwo.mdx +1 -1
- package/api-docs/functions/playVideo.mdx +6 -4
- package/api-docs/functions/processAverageVolume.mdx +1 -1
- package/api-docs/functions/rms.mdx +1 -1
- package/api-docs/functions/subscribeWorkletNode.mdx +1 -1
- package/api-docs/functions/sum.mdx +1 -1
- package/api-docs/interfaces/AnalyzerSubscribableOptions.mdx +5 -3
- package/api-docs/interfaces/AudioGraph.mdx +2 -2
- package/api-docs/interfaces/AudioNodeInit.mdx +10 -6
- package/api-docs/interfaces/AudioNodeProps.mdx +3 -3
- package/api-docs/interfaces/Benchmark.mdx +3 -3
- package/api-docs/interfaces/Clock.mdx +1 -1
- package/api-docs/interfaces/Denoise.mdx +2 -2
- package/api-docs/interfaces/InputProcessAdaptor.mdx +6 -2
- package/api-docs/interfaces/MPMask.mdx +1 -1
- package/api-docs/interfaces/Process.mdx +5 -5
- package/api-docs/interfaces/ProcessWorkerDebugMessage.mdx +1 -1
- package/api-docs/interfaces/ProcessWorkerEventClosed.mdx +5 -0
- package/api-docs/interfaces/ProcessorEvent.mdx +2 -1
- package/api-docs/interfaces/ProcessorProcessOptions.mdx +2 -2
- package/api-docs/interfaces/ProcessorUpdateOptions.mdx +3 -1
- package/api-docs/interfaces/ReadWritableStream.mdx +2 -2
- package/api-docs/interfaces/RenderEventHandlers.mdx +3 -3
- package/api-docs/interfaces/Renderer.mdx +3 -1
- package/api-docs/interfaces/RendererOptions.mdx +5 -5
- package/api-docs/interfaces/Runner.mdx +3 -3
- package/api-docs/interfaces/Segmentation.mdx +1 -1
- package/api-docs/interfaces/Segmenter.mdx +39 -19
- package/api-docs/interfaces/VideoFrameLike.mdx +1 -1
- package/api-docs/interfaces/VideoProcessor.mdx +7 -7
- package/api-docs/interfaces/WorkletMessagePortOptions.mdx +2 -2
- package/api-docs/type-aliases/AsyncCallback.mdx +1 -1
- package/api-docs/type-aliases/Callback.mdx +2 -2
- package/api-docs/type-aliases/ExtractMessageEventType.mdx +1 -1
- package/api-docs/type-aliases/IncludeMessageEventDataType.mdx +1 -1
- package/api-docs/type-aliases/Logger.mdx +12 -0
- package/api-docs/type-aliases/OptionalKeys.mdx +1 -1
- package/api-docs/type-aliases/ProcessWorkerEvents.mdx +1 -0
- package/api-docs/type-aliases/RunnerCreator.mdx +3 -3
- package/api-docs/type-aliases/TupleOf.mdx +1 -1
- package/api-docs/variables/RENDER_BACKEND.mdx +1 -0
- package/api-docs/variables/cloneImageRecord.mdx +3 -1
- package/api-docs/variables/createLazyProps.mdx +1 -1
- package/api-docs/variables/createObjectUpdater.mdx +2 -2
- package/api-docs/variables/createRemoteImageBitmap.mdx +5 -5
- package/api-docs/variables/getCanUseWebGL.mdx +7 -0
- package/api-docs/variables/handleWebGLContextLoss.mdx +1 -1
- package/api-docs/variables/urls.mdx +2 -2
- package/dist/common/backends/canvas2d/renderer.d.ts +2 -0
- package/dist/common/backends/canvas2d/renderer.js +36 -0
- package/dist/common/backends/webgl/blur.d.ts +1 -1
- package/dist/common/backends/webgl/blur.js +11 -25
- package/dist/common/backends/webgl/renderer.js +4 -4
- package/dist/common/backends/webgpu/dualFilterBlur.js +93 -114
- package/dist/common/canvasRenderUtils.d.ts +23 -4
- package/dist/common/canvasRenderUtils.js +48 -11
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +1 -0
- package/dist/common/inferencer.d.ts +18 -0
- package/dist/common/inferencer.js +60 -0
- package/dist/common/tsconfig.tsbuildinfo +1 -1
- package/dist/common/types/messageEvents.d.ts +4 -1
- package/dist/common/types/processor.d.ts +1 -0
- package/dist/common/utils.d.ts +1 -0
- package/dist/common/utils.js +13 -0
- package/dist/main/audio.js +20 -2
- package/dist/main/benchUtils.d.ts +28 -18
- package/dist/main/benchUtils.js +66 -56
- package/dist/main/tsconfig.tsbuildinfo +1 -1
- package/dist/main/utils.d.ts +9 -0
- package/dist/main/utils.js +12 -0
- package/dist/main/video/segmenter.d.ts +8 -1
- package/dist/main/video/segmenter.js +44 -29
- package/dist/main/video/types.d.ts +1 -1
- package/dist/main/video/video.d.ts +1 -1
- package/dist/main/video/video.js +25 -12
- package/dist/workers/mediaWorker.js +23 -23
- package/dist/workers/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 22.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 746f6b6: Add Canvas2d rendering backend support: alpha mask converter,
|
|
8
|
+
Canvas2d mask renderer, canvas dimension-aware rendering, and proper backend
|
|
9
|
+
propagation through the video processor pipeline.
|
|
10
|
+
- c101d02: Add inferencer
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- f4af45a: Fix how we calculate the FPS
|
|
15
|
+
- 476acbf: Fix the background image disappearing when it is replaced by another
|
|
16
|
+
image with the same key. `setImage` closes the previously cached bitmap, so
|
|
17
|
+
the render options kept pointing at a closed `ImageBitmap` until the pipeline
|
|
18
|
+
restarted. The currently rendered image is now repointed at the new bitmap.
|
|
19
|
+
- 7c99e29: Fix hardware acceleration feature detection
|
|
20
|
+
- 1b82fd5: Fix dynamic texture allocation issue
|
|
21
|
+
- 265c898: Migrate test runner from Jest to Vitest.
|
|
22
|
+
- a5e8026: Fix "We can't find your microphone" error when changing the
|
|
23
|
+
microphone while sharing content without audio. The audio mixing processor no
|
|
24
|
+
longer tries to create an audio source node from a presentation stream that
|
|
25
|
+
has no audio track, and audio nodes belonging to a stale `AudioContext` are
|
|
26
|
+
recreated instead of being reused.
|
|
27
|
+
- 0878b3b: Fix race conditions in the video processing pipeline so effect
|
|
28
|
+
changes made during processor startup are correctly applied and worker option
|
|
29
|
+
diffs are computed against the previous state.
|
|
30
|
+
- Updated dependencies [5a17991]
|
|
31
|
+
- Updated dependencies [265c898]
|
|
32
|
+
- @pexip/utils@17.4.1
|
|
33
|
+
|
|
34
|
+
## 22.1.0
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 136aa70: Fix race on close
|
|
39
|
+
- ad47e6a: Log Segmenter with different level
|
|
40
|
+
- Updated dependencies [44ad859]
|
|
41
|
+
- Updated dependencies [514c523]
|
|
42
|
+
- @pexip/utils@17.4.0
|
|
43
|
+
|
|
3
44
|
## 22.0.0
|
|
4
45
|
|
|
5
46
|
### Major Changes
|
package/api-docs/README.mdx
CHANGED
|
@@ -214,6 +214,7 @@ A library for media analysis using Web APIs.
|
|
|
214
214
|
| [ProcessWorkerEventProcessed](interfaces/ProcessWorkerEventProcessed.mdx) | - |
|
|
215
215
|
| [ProcessWorkerEventOpened](interfaces/ProcessWorkerEventOpened.mdx) | - |
|
|
216
216
|
| [ProcessWorkerEventUpdated](interfaces/ProcessWorkerEventUpdated.mdx) | - |
|
|
217
|
+
| [ProcessWorkerEventClosed](interfaces/ProcessWorkerEventClosed.mdx) | - |
|
|
217
218
|
| [ProcessWorkerEvent](interfaces/ProcessWorkerEvent.mdx) | - |
|
|
218
219
|
| [ProcessWorkerEventDebug](interfaces/ProcessWorkerEventDebug.mdx) | - |
|
|
219
220
|
| [FrameTransformStats](interfaces/FrameTransformStats.mdx) | Frame transform statistic, i.e. the timing data for processing each frame |
|
|
@@ -318,6 +319,7 @@ A library for media analysis using Web APIs.
|
|
|
318
319
|
| [Callback](type-aliases/Callback.mdx) | - |
|
|
319
320
|
| [RunnerCreator](type-aliases/RunnerCreator.mdx) | - |
|
|
320
321
|
| [WasmPaths](type-aliases/WasmPaths.mdx) | - |
|
|
322
|
+
| [Logger](type-aliases/Logger.mdx) | - |
|
|
321
323
|
| [Color](type-aliases/Color.mdx) | - |
|
|
322
324
|
| [InputFrame](type-aliases/InputFrame.mdx) | - |
|
|
323
325
|
|
|
@@ -369,6 +371,7 @@ A library for media analysis using Web APIs.
|
|
|
369
371
|
| [handleWebGLContextLoss](variables/handleWebGLContextLoss.mdx) | - |
|
|
370
372
|
| [cloneImageRecord](variables/cloneImageRecord.mdx) | - |
|
|
371
373
|
| [compareImageRecords](variables/compareImageRecords.mdx) | Compare provided ImageRecord |
|
|
374
|
+
| [getCanUseWebGL](variables/getCanUseWebGL.mdx) | - |
|
|
372
375
|
| [urls](variables/urls.mdx) | - |
|
|
373
376
|
| [SILENT\_THRESHOLD](variables/SILENT_THRESHOLD.mdx) | Default silent threshold At least one LSB 16-bit data (compare is on absolute value). |
|
|
374
377
|
| [MONO\_THRESHOLD](variables/MONO_THRESHOLD.mdx) | Default mono detection threshold Data must be identical within one LSB 16-bit to be identified as mono. |
|
|
@@ -384,7 +387,7 @@ A library for media analysis using Web APIs.
|
|
|
384
387
|
|
|
385
388
|
| Function | Description |
|
|
386
389
|
| ------ | ------ |
|
|
387
|
-
| [nearestPowerOfTwo](functions/nearestPowerOfTwo.mdx) | Coerce any positive number to the nearest power of two within [minPow, maxPow] Example: nearestPowerOfTwo(13)
|
|
390
|
+
| [nearestPowerOfTwo](functions/nearestPowerOfTwo.mdx) | Coerce any positive number to the nearest power of two within [minPow, maxPow] Example: nearestPowerOfTwo(13) =\> 16; nearestPowerOfTwo(3.2) =\> 4 |
|
|
388
391
|
| [iou](functions/iou.mdx) | Intersection over Union (IoU), how much two masks overlap as a fraction of either's total. 1.0 = perfect match, 0 = no overlap. Used for stable, robust tracking of the main person between frames, especially with bystander removal and temporal instance switching. |
|
|
389
392
|
| [labelComponents](functions/labelComponents.mdx) | - |
|
|
390
393
|
| [scoreComponent](functions/scoreComponent.mdx) | - |
|
|
@@ -12,16 +12,16 @@ the `frameRate`
|
|
|
12
12
|
|
|
13
13
|
| Type Parameter |
|
|
14
14
|
| ------ |
|
|
15
|
-
| `P
|
|
16
|
-
| `R
|
|
15
|
+
| `P extends unknown[]` |
|
|
16
|
+
| `R extends Promise<unknown>` |
|
|
17
17
|
|
|
18
18
|
## Parameters
|
|
19
19
|
|
|
20
20
|
| Parameter | Type | Description |
|
|
21
21
|
| ------ | ------ | ------ |
|
|
22
|
-
| `callback` | [`Callback
|
|
22
|
+
| `callback` | [`Callback<R, P>`](../type-aliases/Callback.mdx) | The callback to be invoked |
|
|
23
23
|
| `frameRate` | `number` | The rate to be expected to invoke the `callback` |
|
|
24
|
-
| `__namedParameters` | `Partial
|
|
24
|
+
| `__namedParameters` | `Partial<AsyncCallbackLoopOptions>` | - |
|
|
25
25
|
|
|
26
26
|
## Returns
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ the `frameRate`
|
|
|
29
29
|
|
|
30
30
|
| Name | Type |
|
|
31
31
|
| ------ | ------ |
|
|
32
|
-
| `start()` | (
|
|
33
|
-
| `stop()` | () =>
|
|
32
|
+
| `start()` | `(...params) => Promise<void>` |
|
|
33
|
+
| `stop()` | `() => void` |
|
|
34
34
|
| `get frameRate` | `number` |
|
|
35
35
|
| `set frameRate` | `void` |
|
|
@@ -18,8 +18,8 @@ lastCheck | silent | should call onSignalDetected
|
|
|
18
18
|
|
|
19
19
|
| Parameter | Type |
|
|
20
20
|
| ------ | ------ |
|
|
21
|
-
| `shouldDetect` | () =>
|
|
22
|
-
| `onDetected` | (
|
|
21
|
+
| `shouldDetect` | `() => boolean` |
|
|
22
|
+
| `onDetected` | `(silent) => void` |
|
|
23
23
|
|
|
24
24
|
## Returns
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ lastCheck | silent | should call onSignalDetected
|
|
|
31
31
|
|
|
32
32
|
| Parameter | Type |
|
|
33
33
|
| ------ | ------ |
|
|
34
|
-
| `buffer` | `Queue
|
|
34
|
+
| `buffer` | `Queue<number[]>` |
|
|
35
35
|
| `threshold?` | `number` |
|
|
36
36
|
|
|
37
37
|
### Returns
|
|
@@ -44,7 +44,7 @@ lastCheck | silent | should call onSignalDetected
|
|
|
44
44
|
|
|
45
45
|
| Parameter | Type |
|
|
46
46
|
| ------ | ------ |
|
|
47
|
-
| `samples` | `number
|
|
47
|
+
| `samples` | `number[]` |
|
|
48
48
|
|
|
49
49
|
#### Returns
|
|
50
50
|
|
|
@@ -9,7 +9,7 @@ AudioStats builder
|
|
|
9
9
|
| Parameter | Type | Description |
|
|
10
10
|
| ------ | ------ | ------ |
|
|
11
11
|
| `stats` | `Partial`\<[`AudioStats`](../interfaces/AudioStats.mdx)\> | overwrite the default attributes |
|
|
12
|
-
| `options` |
|
|
12
|
+
| `options` | `{ silentThreshold?: number; lowVolumeThreshold?: number; clipCountThreshold?: number; }` | `silentThreshold`, `lowVolumeThreshold` and `clipCountThreshold` |
|
|
13
13
|
| `options.silentThreshold?` | `number` | - |
|
|
14
14
|
| `options.lowVolumeThreshold?` | `number` | - |
|
|
15
15
|
| `options.clipCountThreshold?` | `number` | - |
|
|
@@ -15,12 +15,13 @@ Creates a benchmarking utility for measuring frame durations and calculating fra
|
|
|
15
15
|
|
|
16
16
|
[`Benchmark`](../interfaces/Benchmark.mdx)
|
|
17
17
|
|
|
18
|
-
An object with methods to start/end frame measurements, reset the benchmark, and
|
|
18
|
+
An object with methods to start/end frame measurements, reset the benchmark, and get current FPS.
|
|
19
19
|
|
|
20
20
|
## Remarks
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
Uses a time-windowed sliding approach: each frame event stores both its timestamp and
|
|
23
|
+
processing duration. Only events within the configured time window contribute to FPS.
|
|
24
|
+
FPS is derived as `windowMs / averageProcessingTime` for events in the window.
|
|
25
|
+
|
|
26
|
+
The `begin()`/`end()` API measures processing time per frame explicitly.
|
|
27
|
+
Call `fps()` at any time to get the current FPS — no priming or two-call pattern needed.
|
|
@@ -12,7 +12,7 @@ Create a ChannelSplitterNode
|
|
|
12
12
|
|
|
13
13
|
## Returns
|
|
14
14
|
|
|
15
|
-
[`AudioNodeInit
|
|
15
|
+
[`AudioNodeInit<ChannelSplitterNode, ChannelSplitterNode>`](../interfaces/AudioNodeInit.mdx)
|
|
16
16
|
|
|
17
17
|
## See
|
|
18
18
|
|
|
@@ -9,8 +9,8 @@ Create a noise suppression node
|
|
|
9
9
|
| Parameter | Type | Description |
|
|
10
10
|
| ------ | ------ | ------ |
|
|
11
11
|
| `data` | `BufferSource` | WebAssembly source |
|
|
12
|
-
| `messageHandler?` | (
|
|
12
|
+
| `messageHandler?` | `(vads) => void` | - |
|
|
13
13
|
|
|
14
14
|
## Returns
|
|
15
15
|
|
|
16
|
-
[`AudioNodeInit
|
|
16
|
+
[`AudioNodeInit<AudioWorkletNode, AudioWorkletNode>`](../interfaces/AudioNodeInit.mdx)
|
|
@@ -19,7 +19,7 @@ fallback implementation based on `setTimeout`.
|
|
|
19
19
|
|
|
20
20
|
| Parameter | Type | Description |
|
|
21
21
|
| ------ | ------ | ------ |
|
|
22
|
-
| `callback` | [`Callback`](../type-aliases/Callback.mdx)\<`Promise
|
|
22
|
+
| `callback` | [`Callback`](../type-aliases/Callback.mdx)\<`Promise<void>`, \[`T`\]\> | To be called by the loop |
|
|
23
23
|
| `frameRate` | `number` | A fallback frame rate when we are not able to get the rate from API |
|
|
24
24
|
| `__namedParameters` | `FrameCallbackRequestOptions` | - |
|
|
25
25
|
|
|
@@ -29,7 +29,7 @@ fallback implementation based on `setTimeout`.
|
|
|
29
29
|
|
|
30
30
|
| Name | Type |
|
|
31
31
|
| ------ | ------ |
|
|
32
|
-
| `start()` | (
|
|
33
|
-
| `stop()` | () =>
|
|
32
|
+
| `start()` | `(input) => Promise<void>` |
|
|
33
|
+
| `stop()` | `() => void` |
|
|
34
34
|
| `get frameRate` | `number` |
|
|
35
35
|
| `set frameRate` | `void` |
|
|
@@ -12,4 +12,4 @@ Create a MediaStreamAudioSourceNodeInit
|
|
|
12
12
|
|
|
13
13
|
## Returns
|
|
14
14
|
|
|
15
|
-
[`AudioNodeInit
|
|
15
|
+
[`AudioNodeInit<MediaElementAudioSourceNode, MediaElementAudioSourceNode>`](../interfaces/AudioNodeInit.mdx)
|
|
@@ -9,7 +9,7 @@ An implementation of `InputProcessAdaptor` which uses `HTMLCanvasElement` or
|
|
|
9
9
|
|
|
10
10
|
| Parameter | Type | Description |
|
|
11
11
|
| ------ | ------ | ------ |
|
|
12
|
-
| `__namedParameters` |
|
|
12
|
+
| `__namedParameters` | `{ frameRate: number; }` | - |
|
|
13
13
|
| `__namedParameters.frameRate` | `number` | Fallback frame rate |
|
|
14
14
|
|
|
15
15
|
## Returns
|
|
@@ -6,7 +6,7 @@ function createSegmenter(basePath, __namedParameters): Segmenter;
|
|
|
6
6
|
|
|
7
7
|
| Parameter | Type | Default value | Description |
|
|
8
8
|
| ------ | ------ | ------ | ------ |
|
|
9
|
-
| `basePath` | `string
|
|
9
|
+
| `basePath` | `string \| undefined` | `'/'` | A base path to specify the directory the Wasm files should be loaded from. If not provided, it will be loaded from the host's root directory. **See** [FileResolver](https://ai.google.dev/edge/api/mediapipe/js/tasks-vision.filesetresolver#filesetresolverforvisiontasks) |
|
|
10
10
|
| `__namedParameters` | `Options` | `...` | - |
|
|
11
11
|
|
|
12
12
|
## Returns
|
|
@@ -12,4 +12,4 @@ Create a MediaStreamAudioDestinationNodeInit
|
|
|
12
12
|
|
|
13
13
|
## Returns
|
|
14
14
|
|
|
15
|
-
[`AudioNodeInit
|
|
15
|
+
[`AudioNodeInit<MediaStreamAudioDestinationNode, MediaStreamAudioDestinationNode>`](../interfaces/AudioNodeInit.mdx)
|
|
@@ -13,4 +13,4 @@ Create a MediaStreamAudioSourceNodeInit
|
|
|
13
13
|
|
|
14
14
|
## Returns
|
|
15
15
|
|
|
16
|
-
[`AudioNodeInit
|
|
16
|
+
[`AudioNodeInit<MediaStreamAudioSourceNode, MediaStreamAudioSourceNode>`](../interfaces/AudioNodeInit.mdx)
|
|
@@ -11,8 +11,8 @@ Create a voice detector based on provided params
|
|
|
11
11
|
|
|
12
12
|
| Parameter | Type | Description |
|
|
13
13
|
| ------ | ------ | ------ |
|
|
14
|
-
| `onDetected` | () =>
|
|
15
|
-
| `shouldDetect` | () =>
|
|
14
|
+
| `onDetected` | `() => void` | When there is voice activity, this callback will be called |
|
|
15
|
+
| `shouldDetect` | `() => boolean` | When return `true`, voice activity will function, otherwise, not function |
|
|
16
16
|
| `options?` | [`ThrottleOptions`](../interfaces/ThrottleOptions.mdx) | |
|
|
17
17
|
|
|
18
18
|
## Returns
|
|
@@ -31,7 +31,7 @@ Create a voice detector based on provided params
|
|
|
31
31
|
|
|
32
32
|
| Parameter | Type |
|
|
33
33
|
| ------ | ------ |
|
|
34
|
-
| `isVoice` | [`IsVoice
|
|
34
|
+
| `isVoice` | [`IsVoice<T>`](../type-aliases/IsVoice.mdx) |
|
|
35
35
|
|
|
36
36
|
### Returns
|
|
37
37
|
|
|
@@ -14,10 +14,10 @@ function createWindowedStats(windowSize): object;
|
|
|
14
14
|
|
|
15
15
|
| Name | Type |
|
|
16
16
|
| ------ | ------ |
|
|
17
|
-
| `add()` | (
|
|
17
|
+
| `add()` | `(value) => void` |
|
|
18
18
|
| `get mean` | `number` |
|
|
19
19
|
| `get variance` | `number` |
|
|
20
20
|
| `get stddev` | `number` |
|
|
21
21
|
| `get stdError` | `number` |
|
|
22
22
|
| `get count` | `number` |
|
|
23
|
-
| `clear()` | () =>
|
|
23
|
+
| `clear()` | `() => void` |
|
|
@@ -6,7 +6,7 @@ function nearestPowerOfTwo(
|
|
|
6
6
|
```
|
|
7
7
|
|
|
8
8
|
Coerce any positive number to the nearest power of two within [minPow, maxPow]
|
|
9
|
-
Example: nearestPowerOfTwo(13)
|
|
9
|
+
Example: nearestPowerOfTwo(13) =\> 16; nearestPowerOfTwo(3.2) =\> 4
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
@@ -7,10 +7,12 @@ function playVideo(video, __namedParameters): Promise<[void, void]> | undefined;
|
|
|
7
7
|
| Parameter | Type |
|
|
8
8
|
| ------ | ------ |
|
|
9
9
|
| `video` | `HTMLVideoElement` |
|
|
10
|
-
| `__namedParameters` |
|
|
11
|
-
| `__namedParameters.setTimeout?` | (
|
|
12
|
-
| `__namedParameters.clearTimeout?` | (
|
|
10
|
+
| `__namedParameters` | `{ setTimeout?: (handler, timeout?, ...arguments) => number & (handler, timeout?, ...arguments) => number; clearTimeout?: (id) => void & (id) => void; }` |
|
|
11
|
+
| `__namedParameters.setTimeout?` | `(handler, timeout?, ...arguments) => number & (handler, timeout?, ...arguments) => number` |
|
|
12
|
+
| `__namedParameters.clearTimeout?` | `(id) => void & (id) => void` |
|
|
13
13
|
|
|
14
14
|
## Returns
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
```ts
|
|
17
|
+
Promise<[void, void]> | undefined
|
|
18
|
+
```
|
|
@@ -15,7 +15,7 @@ Subscribe MessagePort message from an AudioWorkletNode
|
|
|
15
15
|
| Parameter | Type | Description |
|
|
16
16
|
| ------ | ------ | ------ |
|
|
17
17
|
| `workletNode` | `AudioWorkletNode` | the node to subscribe |
|
|
18
|
-
| `options` | `Partial`\<[`WorkletMessagePortOptions
|
|
18
|
+
| `options` | `Partial`\<[`WorkletMessagePortOptions<T>`](../interfaces/WorkletMessagePortOptions.mdx)\> | can pass a message handler here to handle the message |
|
|
19
19
|
|
|
20
20
|
## Returns
|
|
21
21
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
## Extends
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```ts
|
|
4
|
+
- SubscribableOptions.WorkletMessagePortOptions<Analyzer>
|
|
5
|
+
```
|
|
4
6
|
|
|
5
7
|
## Properties
|
|
6
8
|
|
|
7
9
|
| Property | Type | Inherited from |
|
|
8
10
|
| ------ | ------ | ------ |
|
|
9
11
|
| <a id="updatefrequency"></a> `updateFrequency?` | `number` | [`SubscribableOptions`](SubscribableOptions.mdx).[`updateFrequency`](SubscribableOptions.mdx#updatefrequency) |
|
|
10
|
-
| <a id="messagehandler"></a> `messageHandler` | (
|
|
11
|
-
| <a id="errorhandler"></a> `errorHandler?` | (
|
|
12
|
+
| <a id="messagehandler"></a> `messageHandler` | `(message) => void` | [`WorkletMessagePortOptions`](WorkletMessagePortOptions.mdx).[`messageHandler`](WorkletMessagePortOptions.mdx#messagehandler) |
|
|
13
|
+
| <a id="errorhandler"></a> `errorHandler?` | `(event) => void` | [`WorkletMessagePortOptions`](WorkletMessagePortOptions.mdx).[`errorHandler`](WorkletMessagePortOptions.mdx#errorhandler) |
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
## Extends
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```ts
|
|
4
|
+
- Readonly<AudioNodeProps<T, R>>
|
|
5
|
+
```
|
|
4
6
|
|
|
5
7
|
## Type Parameters
|
|
6
8
|
|
|
7
9
|
| Type Parameter | Default type |
|
|
8
10
|
| ------ | ------ |
|
|
9
|
-
| `T
|
|
11
|
+
| `T extends AudioNode` | `AudioNode` |
|
|
10
12
|
| `R` *extends* [`BaseAudioNode`](../type-aliases/BaseAudioNode.mdx) | [`BaseAudioNode`](../type-aliases/BaseAudioNode.mdx) |
|
|
11
13
|
|
|
12
14
|
## Properties
|
|
@@ -14,10 +16,10 @@
|
|
|
14
16
|
| Property | Modifier | Type | Inherited from |
|
|
15
17
|
| ------ | ------ | ------ | ------ |
|
|
16
18
|
| <a id="name"></a> `name` | `readonly` | `string` | `Readonly.name` |
|
|
17
|
-
| <a id="node"></a> `node` | `readonly` | `R
|
|
18
|
-
| <a id="audionode"></a> `audioNode` | `readonly` | `T
|
|
19
|
+
| <a id="node"></a> `node` | `readonly` | `R \| undefined` | `Readonly.node` |
|
|
20
|
+
| <a id="audionode"></a> `audioNode` | `readonly` | `T \| undefined` | `Readonly.audioNode` |
|
|
19
21
|
| <a id="outputs"></a> `outputs` | `readonly` | `WeakSet`\< \| `AudioNodeInit`\<`AudioNode`, [`BaseAudioNode`](../type-aliases/BaseAudioNode.mdx)\> \| `AudioParam`\> | `Readonly.outputs` |
|
|
20
|
-
| <a id="tojson"></a> `toJSON?` | `public` | () =>
|
|
22
|
+
| <a id="tojson"></a> `toJSON?` | `public` | `() => unknown` | - |
|
|
21
23
|
|
|
22
24
|
## Methods
|
|
23
25
|
|
|
@@ -41,7 +43,9 @@ Should ONLY be CALLED inside an AudioGraph
|
|
|
41
43
|
|
|
42
44
|
#### Returns
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
```ts
|
|
47
|
+
[T, R]
|
|
48
|
+
```
|
|
45
49
|
|
|
46
50
|
***
|
|
47
51
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
| Type Parameter |
|
|
4
4
|
| ------ |
|
|
5
|
-
| `T
|
|
5
|
+
| `T extends AudioNode` |
|
|
6
6
|
| `R` *extends* [`BaseAudioNode`](../type-aliases/BaseAudioNode.mdx) |
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
| Property | Type |
|
|
11
11
|
| ------ | ------ |
|
|
12
12
|
| <a id="name"></a> `name` | `string` |
|
|
13
|
-
| <a id="node"></a> `node` | `R
|
|
14
|
-
| <a id="audionode"></a> `audioNode` | `T
|
|
13
|
+
| <a id="node"></a> `node` | `R \| undefined` |
|
|
14
|
+
| <a id="audionode"></a> `audioNode` | `T \| undefined` |
|
|
15
15
|
| <a id="outputs"></a> `outputs` | `WeakSet`\< \| [`AudioNodeInit`](AudioNodeInit.mdx)\<`AudioNode`, [`BaseAudioNode`](../type-aliases/BaseAudioNode.mdx)\> \| `AudioParam`\> |
|
|
@@ -42,8 +42,8 @@ pipe(inputs, outputs): void;
|
|
|
42
42
|
|
|
43
43
|
| Parameter | Type |
|
|
44
44
|
| ------ | ------ |
|
|
45
|
-
| `inputs` | `Float32Array
|
|
46
|
-
| `outputs` | `Float32Array
|
|
45
|
+
| `inputs` | `Float32Array<ArrayBufferLike>[]`[] |
|
|
46
|
+
| `outputs` | `Float32Array<ArrayBufferLike>[]`[] |
|
|
47
47
|
|
|
48
48
|
#### Returns
|
|
49
49
|
|
|
@@ -24,5 +24,9 @@ Adapt the provided input track based on browser capabilities.
|
|
|
24
24
|
|
|
25
25
|
#### Returns
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
```ts
|
|
28
|
+
| MediaStreamTrack
|
|
29
|
+
```
|
|
30
|
+
```ts
|
|
31
|
+
| ReadWritableStream<VideoFrame>
|
|
32
|
+
```
|