@pexip/media-processor 21.0.0 → 22.1.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 +80 -0
- package/README.md +17 -10
- package/api-docs/README.mdx +40 -19
- package/api-docs/functions/assertMediaStreamVideoTrack.mdx +13 -0
- 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/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 +10 -4
- package/api-docs/functions/createGainGraphNode.mdx +3 -1
- package/api-docs/functions/createMediaElementSourceGraphNode.mdx +1 -1
- package/api-docs/functions/createMediaStreamTrackInputProcessAdaptor.mdx +10 -0
- package/api-docs/functions/createReadWritableStreamFallbackInputProcessAdaptor.mdx +17 -0
- package/api-docs/functions/createReadWritableStreamInputProcessAdaptor.mdx +10 -0
- 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/createVideoProcessor.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/getDefaultInputProcessAdaptor.mdx +17 -0
- package/api-docs/functions/isMediaStreamVideoTrack.mdx +13 -0
- 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 +7 -5
- 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/Analyzer.mdx +4 -0
- 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 +17 -3
- package/api-docs/interfaces/Clock.mdx +1 -1
- package/api-docs/interfaces/Denoise.mdx +2 -2
- package/api-docs/interfaces/FrameTransformStats.mdx +9 -0
- package/api-docs/interfaces/Gain.mdx +4 -0
- package/api-docs/interfaces/ImageSegmenterOptions.mdx +0 -2
- package/api-docs/interfaces/InputProcessAdaptor.mdx +32 -0
- package/api-docs/interfaces/MPMask.mdx +1 -1
- package/api-docs/interfaces/Process.mdx +12 -7
- package/api-docs/interfaces/ProcessEventMute.mdx +6 -0
- package/api-docs/interfaces/ProcessWorkerDebugMessage.mdx +1 -1
- package/api-docs/interfaces/ProcessWorkerEventClosed.mdx +5 -0
- package/api-docs/interfaces/ProcessWorkerEventOpened.mdx +7 -0
- package/api-docs/interfaces/ProcessWorkerEventStats.mdx +6 -0
- package/api-docs/interfaces/ProcessWorkerEventUpdated.mdx +7 -0
- package/api-docs/interfaces/ProcessorEvent.mdx +3 -2
- package/api-docs/interfaces/ProcessorOptions.mdx +0 -1
- package/api-docs/interfaces/ProcessorProcessOptions.mdx +3 -1
- package/api-docs/interfaces/ProcessorUpdateOptions.mdx +17 -0
- package/api-docs/interfaces/ReadWritableStream.mdx +12 -0
- package/api-docs/interfaces/RenderEventHandlers.mdx +3 -3
- package/api-docs/interfaces/Renderer.mdx +5 -3
- package/api-docs/interfaces/RendererOptions.mdx +5 -9
- package/api-docs/interfaces/Runner.mdx +3 -3
- package/api-docs/interfaces/Segmentation.mdx +1 -1
- package/api-docs/interfaces/Segmenter.mdx +115 -16
- package/api-docs/interfaces/SegmenterOptions.mdx +0 -1
- package/api-docs/interfaces/VideoFrameLike.mdx +1 -1
- package/api-docs/interfaces/VideoProcessor.mdx +52 -8
- 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/ProcessEvents.mdx +1 -0
- package/api-docs/type-aliases/ProcessInputType.mdx +3 -1
- package/api-docs/type-aliases/ProcessWorkerEvents.mdx +7 -4
- package/api-docs/type-aliases/ProcessorWorkerEvents.mdx +1 -1
- package/api-docs/type-aliases/RunnerCreator.mdx +3 -3
- package/api-docs/type-aliases/Struct.mdx +9 -0
- package/api-docs/type-aliases/TupleOf.mdx +1 -1
- package/api-docs/variables/FRAME_RATE.mdx +1 -1
- package/api-docs/variables/ImageFetchError.mdx +3 -0
- package/api-docs/variables/MediaStreamTrackTransferable.mdx +5 -0
- package/api-docs/variables/RENDERER_OPTIONS_STRUCT.mdx +3 -0
- package/api-docs/variables/cloneImageRecord.mdx +21 -0
- package/api-docs/variables/compareImageRecords.mdx +18 -0
- 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/handleWebGLContextLoss.mdx +1 -1
- package/api-docs/variables/isRenderOptionsKey.mdx +13 -0
- package/api-docs/variables/isValidGpuAPI.mdx +13 -0
- package/api-docs/variables/urls.mdx +2 -2
- package/dist/common/backends/webgl/renderer.js +2 -12
- package/dist/common/backends/webgl/texture.d.ts +1 -2
- package/dist/common/backends/webgl/texture.js +2 -2
- package/dist/common/backends/webgl/webglUtils.js +8 -4
- package/dist/common/backends/webgpu/renderer.js +2 -12
- package/dist/common/backends/webgpu/tentBlur.js +1 -1
- package/dist/common/backends/webgpu/texture.d.ts +1 -2
- package/dist/common/backends/webgpu/texture.js +6 -2
- package/dist/common/constants.d.ts +3 -0
- package/dist/common/constants.js +4 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +1 -0
- package/dist/common/tsconfig.tsbuildinfo +1 -1
- package/dist/common/typeGuards.d.ts +2 -0
- package/dist/common/typeGuards.js +7 -0
- package/dist/common/types/media.d.ts +5 -1
- package/dist/common/types/messageEvents.d.ts +34 -4
- package/dist/common/types/processor.d.ts +7 -4
- package/dist/common/types/render.d.ts +5 -2
- package/dist/common/types/render.js +23 -1
- package/dist/common/types/segmentation.d.ts +0 -12
- package/dist/common/utils.d.ts +13 -2
- package/dist/common/utils.js +54 -10
- package/dist/main/audio.js +3 -3
- package/dist/main/benchUtils.d.ts +2 -2
- package/dist/main/benchUtils.js +4 -4
- package/dist/main/index.d.ts +1 -1
- package/dist/main/index.js +1 -1
- package/dist/main/tsconfig.tsbuildinfo +1 -1
- package/dist/main/types.d.ts +0 -6
- package/dist/main/utils.d.ts +4 -0
- package/dist/main/utils.js +31 -0
- package/dist/main/video/constants.d.ts +1 -4
- package/dist/main/video/constants.js +1 -5
- package/dist/main/video/index.d.ts +2 -3
- package/dist/main/video/index.js +2 -3
- package/dist/main/video/inputProcessAdaptor.d.ts +30 -0
- package/dist/main/video/inputProcessAdaptor.js +198 -0
- package/dist/main/video/segmenter.d.ts +42 -0
- package/dist/main/video/{segmenters/mediapipe.js → segmenter.js} +130 -75
- package/dist/main/video/typeGuards.d.ts +2 -0
- package/dist/main/video/typeGuards.js +8 -1
- package/dist/main/video/types.d.ts +37 -17
- package/dist/main/video/utils.d.ts +5 -4
- package/dist/main/video/utils.js +49 -44
- package/dist/main/video/video.d.ts +30 -8
- package/dist/main/video/video.js +338 -32
- package/dist/workers/mediaWorker.js +24 -24
- package/dist/workers/tsconfig.tsbuildinfo +1 -1
- package/dist/worklets/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/api-docs/functions/createCanvasTransform.mdx +0 -14
- package/api-docs/functions/createVideoTrackProcessor.mdx +0 -9
- package/api-docs/functions/createVideoTrackProcessorWithFallback.mdx +0 -15
- package/api-docs/interfaces/Detector.mdx +0 -81
- package/api-docs/interfaces/SegmentationParams.mdx +0 -35
- package/api-docs/interfaces/Transform.mdx +0 -62
- package/api-docs/type-aliases/ProcessVideoTrack.mdx +0 -15
- package/api-docs/type-aliases/SegmentationTransform.mdx +0 -3
- package/dist/main/transformer.d.ts +0 -1
- package/dist/main/transformer.js +0 -4
- package/dist/main/video/canvasTransform.d.ts +0 -17
- package/dist/main/video/canvasTransform.js +0 -341
- package/dist/main/video/segmenters/mediapipe.d.ts +0 -22
- package/dist/main/video/transformer.d.ts +0 -9
- package/dist/main/video/transformer.js +0 -68
- package/dist/main/video/videoStreamTrackProcessor.d.ts +0 -20
- package/dist/main/video/videoStreamTrackProcessor.js +0 -86
|
@@ -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` |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function getDefaultInputProcessAdaptor(tryNativeAPI, targetFrameRate): InputProcessAdaptor;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Get the supported InputProcessAdaptor based on feature detection
|
|
6
|
+
and preference provided
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type | Default value | Description |
|
|
11
|
+
| ------ | ------ | ------ | ------ |
|
|
12
|
+
| `tryNativeAPI` | `boolean` | `true` | Whether or not to try to use the Native MediaStreamTrackProcessor APIs |
|
|
13
|
+
| `targetFrameRate` | `number` | `FRAME_RATE` | The target frame rate to use when fallback implementation of video frame extraction rate |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
[`InputProcessAdaptor`](../interfaces/InputProcessAdaptor.mdx)
|
|
@@ -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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
```ts
|
|
2
|
-
function playVideo(video, __namedParameters): Promise<void
|
|
2
|
+
function playVideo(video, __namedParameters): Promise<[void, void]> | undefined;
|
|
3
3
|
```
|
|
4
4
|
|
|
5
5
|
## Parameters
|
|
@@ -7,10 +7,12 @@ function playVideo(video, __namedParameters): Promise<void>;
|
|
|
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
|
|
|
@@ -163,6 +163,8 @@ connect(
|
|
|
163
163
|
input?): AudioNode;
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
+
The **`connect()`** method of the AudioNode interface lets you connect one of the node's outputs to a target, which may be either another AudioNode (thereby directing the sound data to the specified node) or an AudioParam, so that the node's output data is automatically used to change the value of that parameter over time.
|
|
167
|
+
|
|
166
168
|
[MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/connect)
|
|
167
169
|
|
|
168
170
|
##### Parameters
|
|
@@ -216,6 +218,8 @@ BaseAudioNode.connect
|
|
|
216
218
|
disconnect(): void;
|
|
217
219
|
```
|
|
218
220
|
|
|
221
|
+
The **`disconnect()`** method of the AudioNode interface lets you disconnect one or more nodes from the node on which the method is called.
|
|
222
|
+
|
|
219
223
|
[MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
|
|
220
224
|
|
|
221
225
|
##### Returns
|
|
@@ -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`\> |
|
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
### begin()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
begin(): void;
|
|
6
|
+
begin(timestamp?): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
#### Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type |
|
|
12
|
+
| ------ | ------ |
|
|
13
|
+
| `timestamp?` | `number` |
|
|
14
|
+
|
|
9
15
|
#### Returns
|
|
10
16
|
|
|
11
17
|
`void`
|
|
@@ -15,9 +21,15 @@ begin(): void;
|
|
|
15
21
|
### end()
|
|
16
22
|
|
|
17
23
|
```ts
|
|
18
|
-
end(): void;
|
|
24
|
+
end(timestamp?): void;
|
|
19
25
|
```
|
|
20
26
|
|
|
27
|
+
#### Parameters
|
|
28
|
+
|
|
29
|
+
| Parameter | Type |
|
|
30
|
+
| ------ | ------ |
|
|
31
|
+
| `timestamp?` | `number` |
|
|
32
|
+
|
|
21
33
|
#### Returns
|
|
22
34
|
|
|
23
35
|
`void`
|
|
@@ -44,4 +56,6 @@ calculateFps(): [number, number];
|
|
|
44
56
|
|
|
45
57
|
#### Returns
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
```ts
|
|
60
|
+
[number, number]
|
|
61
|
+
```
|
|
@@ -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
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Frame transform statistic, i.e. the timing data for processing each frame
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Property | Type | Description |
|
|
6
|
+
| ------ | ------ | ------ |
|
|
7
|
+
| <a id="start"></a> `start` | `number` | Start time of the transform |
|
|
8
|
+
| <a id="end"></a> `end` | `number` | End time of the transform |
|
|
9
|
+
| <a id="segmentation"></a> `segmentation?` | `number` | Segmentation inference end time |
|
|
@@ -22,6 +22,8 @@ connect(
|
|
|
22
22
|
input?): AudioNode;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
The **`connect()`** method of the AudioNode interface lets you connect one of the node's outputs to a target, which may be either another AudioNode (thereby directing the sound data to the specified node) or an AudioParam, so that the node's output data is automatically used to change the value of that parameter over time.
|
|
26
|
+
|
|
25
27
|
[MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/connect)
|
|
26
28
|
|
|
27
29
|
##### Parameters
|
|
@@ -75,6 +77,8 @@ BaseAudioNode.connect
|
|
|
75
77
|
disconnect(): void;
|
|
76
78
|
```
|
|
77
79
|
|
|
80
|
+
The **`disconnect()`** method of the AudioNode interface lets you disconnect one or more nodes from the node on which the method is called.
|
|
81
|
+
|
|
78
82
|
[MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioNode/disconnect)
|
|
79
83
|
|
|
80
84
|
##### Returns
|
|
@@ -2,7 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
| Property | Type | Description |
|
|
4
4
|
| ------ | ------ | ------ |
|
|
5
|
-
| <a id="canvas"></a> `canvas?` | `OffscreenCanvas` | The canvas element to bind textures to. This has to be set for GPU processing. The task will initialize a WebGL or WebGPU context and throw an error if this fails (e.g. if you have already initialized a different type of context). |
|
|
6
|
-
| <a id="segmentercanvas"></a> `segmenterCanvas?` | `OffscreenCanvas` | The Google TaskVision segmentation model only works with WebGl so we need a separate canvas for this. |
|
|
7
5
|
| <a id="modelasset"></a> `modelAsset?` | [`SegmentationModelAsset`](SegmentationModelAsset.mdx) | - |
|
|
8
6
|
| <a id="delegate"></a> `delegate?` | [`Delegate`](../type-aliases/Delegate.mdx) | Overrides the default backend to use for the provided model. |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
## Properties
|
|
2
|
+
|
|
3
|
+
| Property | Type | Description |
|
|
4
|
+
| ------ | ------ | ------ |
|
|
5
|
+
| <a id="outputtrack"></a> `outputTrack?` | `MediaStreamTrack` | The generated track from the `adapt` function, and only available after calling the `adapt` method otherwise `undefined` |
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
### adapt()
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
adapt(track):
|
|
13
|
+
| MediaStreamTrack
|
|
14
|
+
| ReadWritableStream<VideoFrame>;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Adapt the provided input track based on browser capabilities.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
| Parameter | Type |
|
|
22
|
+
| ------ | ------ |
|
|
23
|
+
| `track` | `MediaStreamTrack` |
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
| MediaStreamTrack
|
|
29
|
+
```
|
|
30
|
+
```ts
|
|
31
|
+
| ReadWritableStream<VideoFrame>
|
|
32
|
+
```
|
|
@@ -4,7 +4,7 @@ Wrapper for a mask produced by a Segmentation Task.
|
|
|
4
4
|
|
|
5
5
|
| Property | Modifier | Type | Description |
|
|
6
6
|
| ------ | ------ | ------ | ------ |
|
|
7
|
-
| <a id="canvas"></a> `canvas` | `readonly` | `OffscreenCanvas
|
|
7
|
+
| <a id="canvas"></a> `canvas` | `readonly` | `OffscreenCanvas \| undefined` | Returns the canvas element that the mask is bound to. |
|
|
8
8
|
| <a id="width"></a> `width` | `readonly` | `number` | Returns the width of the mask. |
|
|
9
9
|
| <a id="height"></a> `height` | `readonly` | `number` | Returns the height of the mask. |
|
|
10
10
|
|
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
## Extended by
|
|
2
2
|
|
|
3
3
|
- [`Segmenter`](Segmenter.mdx)
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
## Type Parameters
|
|
6
|
+
|
|
7
|
+
| Type Parameter |
|
|
8
|
+
| ------ |
|
|
9
|
+
| `T` |
|
|
5
10
|
|
|
6
11
|
## Properties
|
|
7
12
|
|
|
8
13
|
| Property | Type |
|
|
9
14
|
| ------ | ------ |
|
|
10
|
-
| <a id="status"></a> `status` |
|
|
15
|
+
| <a id="status"></a> `status` | `\| "closed" \| "closing" \| "Error" \| "destroyed" \| "destroying" \| "idle" \| "new" \| "opened" \| "opening" \| "processing" \| "updated" \| "updating"` |
|
|
11
16
|
|
|
12
17
|
## Methods
|
|
13
18
|
|
|
14
19
|
### open()
|
|
15
20
|
|
|
16
21
|
```ts
|
|
17
|
-
open(): Promise<
|
|
22
|
+
open(): Promise<T>;
|
|
18
23
|
```
|
|
19
24
|
|
|
20
25
|
#### Returns
|
|
21
26
|
|
|
22
|
-
`Promise
|
|
27
|
+
`Promise<T>`
|
|
23
28
|
|
|
24
29
|
***
|
|
25
30
|
|
|
26
31
|
### close()
|
|
27
32
|
|
|
28
33
|
```ts
|
|
29
|
-
close(): void
|
|
34
|
+
close(): Promise<void>;
|
|
30
35
|
```
|
|
31
36
|
|
|
32
37
|
#### Returns
|
|
33
38
|
|
|
34
|
-
`void
|
|
39
|
+
`Promise<void>`
|
|
35
40
|
|
|
36
41
|
***
|
|
37
42
|
|
|
@@ -43,4 +48,4 @@ destroy(): Promise<void>;
|
|
|
43
48
|
|
|
44
49
|
#### Returns
|
|
45
50
|
|
|
46
|
-
`Promise
|
|
51
|
+
`Promise<void>`
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
| Property | Type |
|
|
4
4
|
| ------ | ------ |
|
|
5
|
-
| <a id="type"></a> `type` |
|
|
5
|
+
| <a id="type"></a> `type` | `\| "Error" \| "ContextCreationError" \| "ContextLost" \| "ContextRestored" \| "ProcessorRestarted" \| "SamplingError"` |
|
|
6
|
+
| <a id="error"></a> `error?` | `Error` |
|
|
6
7
|
| <a id="message"></a> `message?` | `string` |
|
|
7
|
-
| <a id="
|
|
8
|
+
| <a id="track"></a> `track?` | `MediaStreamTrack` |
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
| <a id="backgroundimage"></a> `backgroundImage?` | [`ImageRecord`](ImageRecord.mdx) | - |
|
|
11
11
|
| <a id="restart"></a> `restart?` | `boolean` | - |
|
|
12
12
|
| <a id="basepath"></a> `basePath?` | `string` | [`SegmenterOptions`](SegmenterOptions.mdx).[`basePath`](SegmenterOptions.mdx#basepath) |
|
|
13
|
-
| <a id="output"></a> `output?` | `OffscreenCanvas` \| `null` | [`SegmenterOptions`](SegmenterOptions.mdx).[`output`](SegmenterOptions.mdx#output) |
|
|
14
13
|
| <a id="processingwidth"></a> `processingWidth?` | `number` | [`SegmenterOptions`](SegmenterOptions.mdx).[`processingWidth`](SegmenterOptions.mdx#processingwidth) |
|
|
15
14
|
| <a id="processingheight"></a> `processingHeight?` | `number` | [`SegmenterOptions`](SegmenterOptions.mdx).[`processingHeight`](SegmenterOptions.mdx#processingheight) |
|
|
16
15
|
| <a id="imagesegmenteroptions"></a> `imageSegmenterOptions?` | [`ImageSegmenterOptions`](ImageSegmenterOptions.mdx) | [`SegmenterOptions`](SegmenterOptions.mdx).[`imageSegmenterOptions`](SegmenterOptions.mdx#imagesegmenteroptions) |
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
| Property | Type |
|
|
4
4
|
| ------ | ------ |
|
|
5
|
-
| <a id="
|
|
5
|
+
| <a id="track"></a> `track?` | `MediaStreamTrack` |
|
|
6
|
+
| <a id="readable"></a> `readable?` | `ReadableStream<VideoFrame>` |
|
|
7
|
+
| <a id="writable"></a> `writable?` | `WritableStream<VideoFrame>` |
|
|
6
8
|
| <a id="renderoptions"></a> `renderOptions?` | [`RendererOptions`](RendererOptions.mdx) |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## Extends
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
- Omit<ProcessorOptions, "renderOptions">
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Type | Inherited from |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| <a id="backgroundimage"></a> `backgroundImage?` | [`ImageRecord`](ImageRecord.mdx) | [`ProcessorOptions`](ProcessorOptions.mdx).[`backgroundImage`](ProcessorOptions.mdx#backgroundimage) |
|
|
12
|
+
| <a id="restart"></a> `restart?` | `boolean` | [`ProcessorOptions`](ProcessorOptions.mdx).[`restart`](ProcessorOptions.mdx#restart) |
|
|
13
|
+
| <a id="basepath"></a> `basePath?` | `string` | [`SegmenterOptions`](SegmenterOptions.mdx).[`basePath`](SegmenterOptions.mdx#basepath) |
|
|
14
|
+
| <a id="processingwidth"></a> `processingWidth?` | `number` | [`SegmenterOptions`](SegmenterOptions.mdx).[`processingWidth`](SegmenterOptions.mdx#processingwidth) |
|
|
15
|
+
| <a id="processingheight"></a> `processingHeight?` | `number` | [`SegmenterOptions`](SegmenterOptions.mdx).[`processingHeight`](SegmenterOptions.mdx#processingheight) |
|
|
16
|
+
| <a id="imagesegmenteroptions"></a> `imageSegmenterOptions?` | [`ImageSegmenterOptions`](ImageSegmenterOptions.mdx) | [`SegmenterOptions`](SegmenterOptions.mdx).[`imageSegmenterOptions`](SegmenterOptions.mdx#imagesegmenteroptions) |
|
|
17
|
+
| <a id="renderoptions"></a> `renderOptions?` | `Partial`\<[`RendererOptions`](RendererOptions.mdx)\> | - |
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
| Property | Type |
|
|
4
4
|
| ------ | ------ |
|
|
5
|
-
| <a id="contextlost"></a> `contextLost` | (
|
|
6
|
-
| <a id="contextrestored"></a> `contextRestored` | (
|
|
7
|
-
| <a id="contextcreationerror"></a> `contextCreationError` | (
|
|
5
|
+
| <a id="contextlost"></a> `contextLost` | `(message) => void` |
|
|
6
|
+
| <a id="contextrestored"></a> `contextRestored` | `(message) => void` |
|
|
7
|
+
| <a id="contextcreationerror"></a> `contextCreationError` | `(message) => void` |
|
|
@@ -14,7 +14,9 @@ init(options?): void | Promise<void>;
|
|
|
14
14
|
|
|
15
15
|
#### Returns
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```ts
|
|
18
|
+
void | Promise<void>
|
|
19
|
+
```
|
|
18
20
|
|
|
19
21
|
***
|
|
20
22
|
|
|
@@ -31,8 +33,8 @@ render(
|
|
|
31
33
|
|
|
32
34
|
| Parameter | Type |
|
|
33
35
|
| ------ | ------ |
|
|
34
|
-
| `mask` | `
|
|
35
|
-
| `frame` |
|
|
36
|
+
| `mask` | `OffscreenCanvas` |
|
|
37
|
+
| `frame` | `VideoFrame` |
|
|
36
38
|
| `options` | `Options` |
|
|
37
39
|
|
|
38
40
|
#### Returns
|