@pexip/media-processor 20.3.3 → 20.3.5
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 +15 -0
- package/api-docs/README.mdx +411 -0
- package/api-docs/enumerations/AbortReason.mdx +5 -0
- package/api-docs/functions/avg.mdx +15 -0
- package/api-docs/functions/calculateDistance.mdx +18 -0
- package/api-docs/functions/closedCurve.mdx +27 -0
- package/api-docs/functions/copyByteBufferToFloatBuffer.mdx +16 -0
- package/api-docs/functions/createAnalyzerGraphNode.mdx +19 -0
- package/api-docs/functions/createAnalyzerSubscribableGraphNode.mdx +15 -0
- package/api-docs/functions/createAsyncCallbackLoop.mdx +35 -0
- package/api-docs/functions/createAudioContext.mdx +22 -0
- package/api-docs/functions/createAudioDestinationGraphNode.mdx +9 -0
- package/api-docs/functions/createAudioGraph.mdx +28 -0
- package/api-docs/functions/createAudioGraphProxy.mdx +14 -0
- package/api-docs/functions/createAudioSignalDetector.mdx +51 -0
- package/api-docs/functions/createAudioStats.mdx +19 -0
- package/api-docs/functions/createBenchmark.mdx +14 -0
- package/api-docs/functions/createCanvas.mdx +16 -0
- package/api-docs/functions/createCanvasTransform.mdx +14 -0
- package/api-docs/functions/createChannelMergerGraphNode.mdx +19 -0
- package/api-docs/functions/createChannelSplitterGraphNode.mdx +19 -0
- package/api-docs/functions/createDelayGraphNode.mdx +19 -0
- package/api-docs/functions/createDenoiseWorkletGraphNode.mdx +16 -0
- package/api-docs/functions/createFrameCallbackRequest.mdx +29 -0
- package/api-docs/functions/createGainGraphNode.mdx +15 -0
- package/api-docs/functions/createMediaElementSourceGraphNode.mdx +15 -0
- package/api-docs/functions/createSegmenter.mdx +14 -0
- package/api-docs/functions/createStreamDestinationGraphNode.mdx +15 -0
- package/api-docs/functions/createStreamSourceGraphNode.mdx +16 -0
- package/api-docs/functions/createVADetector.mdx +54 -0
- package/api-docs/functions/createVideoProcessor.mdx +14 -0
- package/api-docs/functions/createVideoTrackProcessor.mdx +9 -0
- package/api-docs/functions/createVideoTrackProcessorWithFallback.mdx +15 -0
- package/api-docs/functions/createVoiceDetectorFromProbability.mdx +15 -0
- package/api-docs/functions/createVoiceDetectorFromTimeData.mdx +19 -0
- package/api-docs/functions/curve.mdx +15 -0
- package/api-docs/functions/fromByteToFloat.mdx +27 -0
- package/api-docs/functions/fromFloatToByte.mdx +27 -0
- package/api-docs/functions/getAudioStats.mdx +19 -0
- package/api-docs/functions/getBezierCurveControlPoints.mdx +26 -0
- package/api-docs/functions/isAnalyzerNodeInit.mdx +13 -0
- package/api-docs/functions/isAudioNode.mdx +13 -0
- package/api-docs/functions/isAudioNodeInit.mdx +13 -0
- package/api-docs/functions/isAudioParam.mdx +13 -0
- package/api-docs/functions/isClipping.mdx +18 -0
- package/api-docs/functions/isEqualSize.mdx +22 -0
- package/api-docs/functions/isLowVolume.mdx +19 -0
- package/api-docs/functions/isMono.mdx +22 -0
- package/api-docs/functions/isRenderEffects.mdx +13 -0
- package/api-docs/functions/isSilent.mdx +22 -0
- package/api-docs/functions/isVoiceActivity.mdx +29 -0
- package/api-docs/functions/line.mdx +15 -0
- package/api-docs/functions/loadScript.mdx +14 -0
- package/api-docs/functions/loadWasms.mdx +13 -0
- package/api-docs/functions/pow.mdx +29 -0
- package/api-docs/functions/processAverageVolume.mdx +15 -0
- package/api-docs/functions/resumeAudioOnInterruption.mdx +23 -0
- package/api-docs/functions/resumeAudioOnUnmute.mdx +27 -0
- package/api-docs/functions/rms.mdx +15 -0
- package/api-docs/functions/round.mdx +23 -0
- package/api-docs/functions/subscribeTimeoutAnalyzerNode.mdx +22 -0
- package/api-docs/functions/subscribeWorkletNode.mdx +28 -0
- package/api-docs/functions/sum.mdx +15 -0
- package/api-docs/functions/toDecibel.mdx +18 -0
- package/api-docs/interfaces/Analyzer.mdx +368 -0
- package/api-docs/interfaces/AnalyzerSubscribableOptions.mdx +11 -0
- package/api-docs/interfaces/AsyncAssets.mdx +7 -0
- package/api-docs/interfaces/AudioGraph.mdx +92 -0
- package/api-docs/interfaces/AudioGraphOptions.mdx +6 -0
- package/api-docs/interfaces/AudioNodeInit.mdx +127 -0
- package/api-docs/interfaces/AudioNodeProps.mdx +15 -0
- package/api-docs/interfaces/AudioStats.mdx +16 -0
- package/api-docs/interfaces/BackgroundImage.mdx +6 -0
- package/api-docs/interfaces/Benchmark.mdx +35 -0
- package/api-docs/interfaces/Clock.mdx +11 -0
- package/api-docs/interfaces/Denoise.mdx +50 -0
- package/api-docs/interfaces/Detector.mdx +81 -0
- package/api-docs/interfaces/Frame.mdx +11 -0
- package/api-docs/interfaces/Gain.mdx +227 -0
- package/api-docs/interfaces/ImageRecord.mdx +6 -0
- package/api-docs/interfaces/ImageSegmenterOptions.mdx +8 -0
- package/api-docs/interfaces/MPMask.mdx +145 -0
- package/api-docs/interfaces/Point.mdx +10 -0
- package/api-docs/interfaces/Process.mdx +46 -0
- package/api-docs/interfaces/ProcessEventClose.mdx +7 -0
- package/api-docs/interfaces/ProcessEventDebug.mdx +14 -0
- package/api-docs/interfaces/ProcessEventDestroy.mdx +7 -0
- package/api-docs/interfaces/ProcessEventOpen.mdx +14 -0
- package/api-docs/interfaces/ProcessEventProcess.mdx +14 -0
- package/api-docs/interfaces/ProcessEventUpdate.mdx +14 -0
- package/api-docs/interfaces/ProcessWorkerDebugMessage.mdx +6 -0
- package/api-docs/interfaces/ProcessWorkerEvent.mdx +12 -0
- package/api-docs/interfaces/ProcessWorkerEventDebug.mdx +12 -0
- package/api-docs/interfaces/ProcessWorkerEventOpened.mdx +5 -0
- package/api-docs/interfaces/ProcessWorkerEventProcessed.mdx +12 -0
- package/api-docs/interfaces/ProcessWorkerEventUpdated.mdx +5 -0
- package/api-docs/interfaces/ProcessorEvent.mdx +7 -0
- package/api-docs/interfaces/ProcessorOptions.mdx +16 -0
- package/api-docs/interfaces/ProcessorProcessOptions.mdx +6 -0
- package/api-docs/interfaces/Rect.mdx +8 -0
- package/api-docs/interfaces/RenderEventHandlers.mdx +7 -0
- package/api-docs/interfaces/Renderer.mdx +64 -0
- package/api-docs/interfaces/RendererOptions.mdx +15 -0
- package/api-docs/interfaces/Runner.mdx +41 -0
- package/api-docs/interfaces/Segmentation.mdx +5 -0
- package/api-docs/interfaces/SegmentationModelAsset.mdx +8 -0
- package/api-docs/interfaces/SegmentationParams.mdx +18 -0
- package/api-docs/interfaces/SegmentationSmoothingConfig.mdx +5 -0
- package/api-docs/interfaces/Segmenter.mdx +121 -0
- package/api-docs/interfaces/SegmenterOptions.mdx +13 -0
- package/api-docs/interfaces/Size.mdx +10 -0
- package/api-docs/interfaces/StatsOptions.mdx +10 -0
- package/api-docs/interfaces/SubscribableOptions.mdx +9 -0
- package/api-docs/interfaces/ThrottleOptions.mdx +8 -0
- package/api-docs/interfaces/Transform.mdx +62 -0
- package/api-docs/interfaces/VideoFrameLike.mdx +8 -0
- package/api-docs/interfaces/VideoProcessor.mdx +38 -0
- package/api-docs/interfaces/WorkletMessagePortOptions.mdx +16 -0
- package/api-docs/interfaces/WorkletModule.mdx +6 -0
- package/api-docs/type-aliases/AnalyzerNodeInit.mdx +3 -0
- package/api-docs/type-aliases/AsyncCallback.mdx +7 -0
- package/api-docs/type-aliases/AudioBufferBytes.mdx +5 -0
- package/api-docs/type-aliases/AudioBufferFloats.mdx +6 -0
- package/api-docs/type-aliases/AudioDestinationNodeInit.mdx +3 -0
- package/api-docs/type-aliases/AudioNodeConnectParam.mdx +3 -0
- package/api-docs/type-aliases/AudioNodeInitConnectParam.mdx +3 -0
- package/api-docs/type-aliases/AudioNodeInitConnection.mdx +3 -0
- package/api-docs/type-aliases/AudioNodeInitConnections.mdx +3 -0
- package/api-docs/type-aliases/AudioNodeParam.mdx +3 -0
- package/api-docs/type-aliases/AudioSamples.mdx +17 -0
- package/api-docs/type-aliases/BaseAudioNode.mdx +3 -0
- package/api-docs/type-aliases/Callback.mdx +20 -0
- package/api-docs/type-aliases/Canvas.mdx +3 -0
- package/api-docs/type-aliases/CanvasContext.mdx +3 -0
- package/api-docs/type-aliases/ChannelSplitterNodeInit.mdx +3 -0
- package/api-docs/type-aliases/Color.mdx +12 -0
- package/api-docs/type-aliases/ConnectInitParamBaseType.mdx +3 -0
- package/api-docs/type-aliases/ConnectInitParamType.mdx +3 -0
- package/api-docs/type-aliases/ConnectParamBase.mdx +11 -0
- package/api-docs/type-aliases/ConnectParamBaseType.mdx +3 -0
- package/api-docs/type-aliases/ConnectParamType.mdx +3 -0
- package/api-docs/type-aliases/DelayNodeInit.mdx +3 -0
- package/api-docs/type-aliases/Delegate.mdx +3 -0
- package/api-docs/type-aliases/DenoiseWorkletNodeInit.mdx +3 -0
- package/api-docs/type-aliases/ExtractMessageEventType.mdx +9 -0
- package/api-docs/type-aliases/GainNodeInit.mdx +3 -0
- package/api-docs/type-aliases/ImageMapIterable.mdx +3 -0
- package/api-docs/type-aliases/ImageType.mdx +6 -0
- package/api-docs/type-aliases/IncludeMessageEventDataType.mdx +10 -0
- package/api-docs/type-aliases/InputFrame.mdx +3 -0
- package/api-docs/type-aliases/IsVoice.mdx +19 -0
- package/api-docs/type-aliases/MediaElementAudioSourceNodeInit.mdx +3 -0
- package/api-docs/type-aliases/MediaStreamAudioDestinationNodeInit.mdx +3 -0
- package/api-docs/type-aliases/MediaStreamAudioSourceNodeInit.mdx +3 -0
- package/api-docs/type-aliases/Node.mdx +3 -0
- package/api-docs/type-aliases/NodeConnectionAction.mdx +3 -0
- package/api-docs/type-aliases/Nodes.mdx +3 -0
- package/api-docs/type-aliases/ProcessEvents.mdx +17 -0
- package/api-docs/type-aliases/ProcessInputType.mdx +3 -0
- package/api-docs/type-aliases/ProcessStatus.mdx +3 -0
- package/api-docs/type-aliases/ProcessVideoTrack.mdx +15 -0
- package/api-docs/type-aliases/ProcessWorkerEvents.mdx +18 -0
- package/api-docs/type-aliases/ProcessorEvents.mdx +3 -0
- package/api-docs/type-aliases/ProcessorWorkerEvents.mdx +3 -0
- package/api-docs/type-aliases/RenderBackend.mdx +3 -0
- package/api-docs/type-aliases/RenderEffects.mdx +3 -0
- package/api-docs/type-aliases/RenderingEvents.mdx +3 -0
- package/api-docs/type-aliases/RunnerCreator.mdx +21 -0
- package/api-docs/type-aliases/SegmentationModel.mdx +3 -0
- package/api-docs/type-aliases/SegmentationTransform.mdx +3 -0
- package/api-docs/type-aliases/TupleOf.mdx +12 -0
- package/api-docs/type-aliases/UniversalAudioContextState.mdx +6 -0
- package/api-docs/type-aliases/Unsubscribe.mdx +9 -0
- package/api-docs/type-aliases/WasmPaths.mdx +3 -0
- package/api-docs/variables/BACKGROUND_BLUR_AMOUNT.mdx +3 -0
- package/api-docs/variables/CLIP_COUNT_THRESHOLD.mdx +6 -0
- package/api-docs/variables/CLIP_THRESHOLD.mdx +5 -0
- package/api-docs/variables/EDGE_BLUR_AMOUNT.mdx +3 -0
- package/api-docs/variables/FOREGROUND_THRESHOLD.mdx +3 -0
- package/api-docs/variables/FRAME_RATE.mdx +3 -0
- package/api-docs/variables/LOW_VOLUME_THRESHOLD.mdx +5 -0
- package/api-docs/variables/MASK_COMBINE_RATIO.mdx +3 -0
- package/api-docs/variables/MONO_THRESHOLD.mdx +6 -0
- package/api-docs/variables/PLAY_VIDEO_TIMEOUT.mdx +3 -0
- package/api-docs/variables/PROCESSING_HEIGHT.mdx +3 -0
- package/api-docs/variables/PROCESSING_WIDTH.mdx +3 -0
- package/api-docs/variables/PROCESS_STATUS.mdx +22 -0
- package/api-docs/variables/RENDERING_EVENTS.mdx +14 -0
- package/api-docs/variables/RENDER_BACKEND.mdx +10 -0
- package/api-docs/variables/RENDER_EFFECT.mdx +11 -0
- package/api-docs/variables/SEGMENTATION_MODELS.mdx +10 -0
- package/api-docs/variables/SILENT_THRESHOLD.mdx +6 -0
- package/api-docs/variables/VOICE_PROBABILITY_THRESHOLD.mdx +5 -0
- package/api-docs/variables/calculateMaxBlurPass.mdx +13 -0
- package/api-docs/variables/clamping.mdx +26 -0
- package/api-docs/variables/createLazyProps.mdx +19 -0
- package/api-docs/variables/createObjectUpdater.mdx +31 -0
- package/api-docs/variables/createRemoteImageBitmap.mdx +21 -0
- package/api-docs/variables/getErrorMessage.mdx +13 -0
- package/api-docs/variables/handleWebGLContextLoss.mdx +21 -0
- package/api-docs/variables/isRenderingEvents.mdx +13 -0
- package/api-docs/variables/isSegmentationModel.mdx +13 -0
- package/api-docs/variables/resize.mdx +30 -0
- package/api-docs/variables/toRenderingEvents.mdx +13 -0
- package/api-docs/variables/urls.mdx +10 -0
- package/package.json +14 -9
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isLowVolume(gain, threshold): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Check if the provided gain above the low volume threshold, which is
|
|
6
|
+
considered as low volume.
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type | Default value | Description |
|
|
11
|
+
| ------ | ------ | ------ | ------ |
|
|
12
|
+
| `gain` | `number` | `undefined` | Floating point representation of the gain number |
|
|
13
|
+
| `threshold` | `number` | `LOW_VOLUME_THRESHOLD` | - |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`boolean`
|
|
18
|
+
|
|
19
|
+
`true` if the `gain` is lower than the threshold
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isMono(channels, threshold): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Check if provided channels are mono or stereo
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default value | Description |
|
|
10
|
+
| ------ | ------ | ------ | ------ |
|
|
11
|
+
| `channels` | [`AudioSamples`](../type-aliases/AudioSamples.mdx)[] | `undefined` | Audio channels and assuming the inputs are in floating point form |
|
|
12
|
+
| `threshold` | `number` | `MONO_THRESHOLD` | Mono detection threshold, default to floating point form |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
`boolean`
|
|
17
|
+
|
|
18
|
+
`true` if they are mono, otherwise stereo
|
|
19
|
+
|
|
20
|
+
## Default Value
|
|
21
|
+
|
|
22
|
+
`1.0 / 32767`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isSilent(samples, threshold): boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Simple silent detection to only check the first and last bit from the sample
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default value | Description |
|
|
10
|
+
| ------ | ------ | ------ | ------ |
|
|
11
|
+
| `samples` | [`AudioSamples`](../type-aliases/AudioSamples.mdx) | `undefined` | Audio sample data, this could be in a form of floating number of a byte number as long as the `threshold` value is given accordingly. |
|
|
12
|
+
| `threshold` | `number` | `SILENT_THRESHOLD` | Silent threshold |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
`boolean`
|
|
17
|
+
|
|
18
|
+
`true` when it is silent
|
|
19
|
+
|
|
20
|
+
## Default Value
|
|
21
|
+
|
|
22
|
+
`1.0 / 32767` assuming the sample is float value
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function isVoiceActivity(options): (volume) => boolean;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
A Naive Voice activity detection
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `options` | `VAOptions` | See `VAOptions` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
`(volume: number) => boolean`, `true` if there is voice
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
(volume): boolean;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type |
|
|
24
|
+
| ------ | ------ |
|
|
25
|
+
| `volume` | `number` |
|
|
26
|
+
|
|
27
|
+
### Returns
|
|
28
|
+
|
|
29
|
+
`boolean`
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function pow(exponent): (base) => number;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
pow function from Math in functional form `number -> number -> number`
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `exponent` | `number` | The exponent used for the expression |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
Math.pow(base, exponent)
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
(base): number;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type |
|
|
24
|
+
| ------ | ------ |
|
|
25
|
+
| `base` | `number` |
|
|
26
|
+
|
|
27
|
+
### Returns
|
|
28
|
+
|
|
29
|
+
`number`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function resumeAudioOnInterruption(audioContext): () => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Alpha`**
|
|
6
|
+
|
|
7
|
+
Resume the stream whenever interrupted
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
| Parameter | Type | Description |
|
|
12
|
+
| ------ | ------ | ------ |
|
|
13
|
+
| `audioContext` | `AudioContext` | AudioContext |
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
(): void;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Returns
|
|
22
|
+
|
|
23
|
+
`void`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function resumeAudioOnUnmute(context): (track) => Unsubscribe;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Alpha`**
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `context` | `AudioContext` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
(track): Unsubscribe;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Parameters
|
|
20
|
+
|
|
21
|
+
| Parameter | Type | Description |
|
|
22
|
+
| ------ | ------ | ------ |
|
|
23
|
+
| `track` | `MediaStreamTrack` | The source track to listen on the `unmute` event |
|
|
24
|
+
|
|
25
|
+
### Returns
|
|
26
|
+
|
|
27
|
+
[`Unsubscribe`](../type-aliases/Unsubscribe.mdx)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function rms(nums): number;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Calculate the Root Mean Square from provided numbers
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `nums` | `number`[] | An array of numbers |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
`number`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function round(num): number;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Round the floating point number away from zero, which is different from
|
|
6
|
+
`Math.round`
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
| Parameter | Type | Description |
|
|
11
|
+
| ------ | ------ | ------ |
|
|
12
|
+
| `num` | `number` | The number to round |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
`number`
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
round(0.5) // 1
|
|
22
|
+
round(-0.5) // -1
|
|
23
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function subscribeTimeoutAnalyzerNode(analyzer, options): () => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Subscribe to a timeout loop to get the data from Analyzer
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `analyzer` | [`Analyzer`](../interfaces/Analyzer.mdx) | the analyzer to subscribe |
|
|
12
|
+
| `options` | [`AnalyzerSubscribableOptions`](../interfaces/AnalyzerSubscribableOptions.mdx) | message handler, etc. |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
(): void;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Returns
|
|
21
|
+
|
|
22
|
+
`void`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function subscribeWorkletNode<T>(workletNode, options): () => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Subscribe MessagePort message from an AudioWorkletNode
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
| Type Parameter |
|
|
10
|
+
| ------ |
|
|
11
|
+
| `T` |
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| ------ | ------ | ------ |
|
|
17
|
+
| `workletNode` | `AudioWorkletNode` | the node to subscribe |
|
|
18
|
+
| `options` | `Partial`\<[`WorkletMessagePortOptions`](../interfaces/WorkletMessagePortOptions.mdx)\<`T`\>\> | can pass a message handler here to handle the message |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
(): void;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Returns
|
|
27
|
+
|
|
28
|
+
`void`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function toDecibel(gain): number;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Convert a floating point gain value into a dB representation without any
|
|
6
|
+
reference, dBFS, https://en.wikipedia.org/wiki/DBFS
|
|
7
|
+
|
|
8
|
+
See https://www.w3.org/TR/webaudio#conversion-to-db
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| ------ | ------ |
|
|
14
|
+
| `gain` | `number` |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`number`
|