@pexip/media-processor 20.3.4 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/api-docs/README.mdx +438 -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 +26 -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/createWindowedStats.mdx +23 -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/iou.mdx +19 -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/labelComponents.mdx +20 -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/nearestPowerOfTwo.mdx +21 -0
- package/api-docs/functions/playVideo.mdx +16 -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/scoreComponent.mdx +22 -0
- package/api-docs/functions/setVideoElementSrc.mdx +14 -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 +47 -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 +32 -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 +35 -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/SelectionOptions.mdx +15 -0
- package/api-docs/interfaces/Size.mdx +10 -0
- package/api-docs/interfaces/Stats.mdx +11 -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/Weights.mdx +12 -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/OptionalKeys.mdx +10 -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/BACKGROUND_THRESHOLD.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/DOWN_SAMPLE_FACTOR.mdx +3 -0
- package/api-docs/variables/EDGE_BLUR_AMOUNT.mdx +3 -0
- package/api-docs/variables/EXCLUDE_BYSTANDERS.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/LIGHT_WRAP_BLUR_AMOUNT.mdx +3 -0
- package/api-docs/variables/LIGHT_WRAP_EDGE_BAND.mdx +3 -0
- package/api-docs/variables/LIGHT_WRAP_INTENSITY.mdx +3 -0
- package/api-docs/variables/LIGHT_WRAP_TIGHTNESS.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/MORPH_DILATE_RADIUS_PX.mdx +3 -0
- package/api-docs/variables/MORPH_ERODE_RADIUS_PX.mdx +3 -0
- package/api-docs/variables/MORPH_PASS.mdx +3 -0
- package/api-docs/variables/PERSON_CENTER.mdx +3 -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/SIGMA_RANGE.mdx +3 -0
- package/api-docs/variables/SIGMA_SPACE.mdx +3 -0
- package/api-docs/variables/SILENT_THRESHOLD.mdx +6 -0
- package/api-docs/variables/STRONG_EDGE_BLUR_AMOUNT.mdx +3 -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/getCanvasRenderingContext2D.mdx +14 -0
- package/api-docs/variables/getErrorMessage.mdx +13 -0
- package/api-docs/variables/getImageSize.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/dist/common/backends/webgl/binaryMask.d.ts +8 -0
- package/dist/common/backends/webgl/binaryMask.js +95 -0
- package/dist/common/backends/webgl/blender.d.ts +2 -1
- package/dist/common/backends/webgl/blender.js +18 -15
- package/dist/common/backends/webgl/blur.d.ts +1 -1
- package/dist/common/backends/webgl/blur.js +23 -16
- package/dist/common/backends/webgl/canvas.js +9 -4
- package/dist/common/backends/webgl/diffAbsMask.d.ts +10 -0
- package/dist/common/backends/webgl/diffAbsMask.js +103 -0
- package/dist/common/backends/webgl/geodesicReconstruction.d.ts +13 -0
- package/dist/common/backends/webgl/geodesicReconstruction.js +176 -0
- package/dist/common/backends/webgl/jointBilateralFilter.d.ts +12 -0
- package/dist/common/backends/webgl/jointBilateralFilter.js +108 -0
- package/dist/common/backends/webgl/morphErode.d.ts +13 -0
- package/dist/common/backends/webgl/morphErode.js +121 -0
- package/dist/common/backends/webgl/renderer.js +194 -34
- package/dist/common/backends/webgl/replace.d.ts +17 -0
- package/dist/common/backends/webgl/replace.js +126 -0
- package/dist/common/backends/webgl/selectComponent.d.ts +15 -0
- package/dist/common/backends/webgl/selectComponent.js +102 -0
- package/dist/common/backends/webgl/smoothingMask.d.ts +3 -3
- package/dist/common/backends/webgl/smoothingMask.js +22 -21
- package/dist/common/backends/webgl/tentBlur.d.ts +9 -0
- package/dist/common/backends/webgl/tentBlur.js +118 -0
- package/dist/common/backends/webgl/texture.d.ts +1 -1
- package/dist/common/backends/webgl/texture.js +19 -17
- package/dist/common/backends/webgl/textureToTexture.d.ts +1 -1
- package/dist/common/backends/webgl/textureToTexture.js +19 -16
- package/dist/common/backends/webgl/webglUtils.d.ts +7 -1
- package/dist/common/backends/webgl/webglUtils.js +64 -6
- package/dist/common/backends/webgpu/blender.d.ts +6 -1
- package/dist/common/backends/webgpu/blender.js +96 -51
- package/dist/common/backends/webgpu/constants.js +1 -1
- package/dist/common/backends/webgpu/dualFilterBlur.d.ts +2 -3
- package/dist/common/backends/webgpu/dualFilterBlur.js +146 -140
- package/dist/common/backends/webgpu/jointBilateralFilter.d.ts +7 -0
- package/dist/common/backends/webgpu/jointBilateralFilter.js +162 -0
- package/dist/common/backends/webgpu/renderer.js +211 -39
- package/dist/common/backends/webgpu/replace.d.ts +11 -0
- package/dist/common/backends/webgpu/replace.js +175 -0
- package/dist/common/backends/webgpu/resize.d.ts +4 -0
- package/dist/common/backends/webgpu/resize.js +76 -0
- package/dist/common/backends/webgpu/smoothingMask.d.ts +2 -2
- package/dist/common/backends/webgpu/smoothingMask.js +74 -40
- package/dist/common/backends/webgpu/tentBlur.d.ts +5 -0
- package/dist/common/backends/webgpu/tentBlur.js +131 -0
- package/dist/common/backends/webgpu/texture.d.ts +2 -2
- package/dist/common/backends/webgpu/texture.js +24 -19
- package/dist/common/backends/webgpu/textureToTexture.d.ts +1 -1
- package/dist/common/backends/webgpu/textureToTexture.js +28 -15
- package/dist/common/backends/webgpu/types.d.ts +2 -0
- package/dist/common/backends/webgpu/webgpuUtils.d.ts +24 -4
- package/dist/common/backends/webgpu/webgpuUtils.js +60 -11
- package/dist/common/constants.d.ts +19 -5
- package/dist/common/constants.js +19 -5
- 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/types/render.d.ts +142 -13
- package/dist/common/types/utils.d.ts +21 -0
- package/dist/common/utils.d.ts +16 -0
- package/dist/common/utils.js +152 -0
- package/dist/main/benchUtils.d.ts +33 -1
- package/dist/main/benchUtils.js +145 -11
- package/dist/main/tsconfig.tsbuildinfo +1 -1
- package/dist/main/video/canvasTransform.d.ts +1 -1
- package/dist/main/video/canvasTransform.js +135 -47
- package/dist/main/video/index.d.ts +1 -1
- package/dist/main/video/index.js +1 -1
- package/dist/workers/mediaWorker.js +35 -162
- package/dist/workers/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -10
- package/dist/common/backends/webgl/shaders/blendFragmentShader.d.ts +0 -1
- package/dist/common/backends/webgl/shaders/blendFragmentShader.js +0 -21
- package/dist/common/backends/webgl/shaders/dualFilterBlurFragmentShader.d.ts +0 -1
- package/dist/common/backends/webgl/shaders/dualFilterBlurFragmentShader.js +0 -45
- package/dist/common/backends/webgl/shaders/smoothingMaskFragmentShader.d.ts +0 -1
- package/dist/common/backends/webgl/shaders/smoothingMaskFragmentShader.js +0 -57
- package/dist/common/backends/webgl/shaders/textureFragmentShader.d.ts +0 -1
- package/dist/common/backends/webgl/shaders/textureFragmentShader.js +0 -16
- package/dist/common/backends/webgl/shaders/vertexShader.d.ts +0 -1
- package/dist/common/backends/webgl/shaders/vertexShader.js +0 -19
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioContext(options?): AudioContext;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
**`Internal`**
|
|
6
|
+
|
|
7
|
+
A function to create `AudioContext` using constructor or factory function
|
|
8
|
+
depends on the browser supports
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Description |
|
|
13
|
+
| ------ | ------ | ------ |
|
|
14
|
+
| `options?` | `AudioContextOptions` | |
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`AudioContext`
|
|
19
|
+
|
|
20
|
+
## See
|
|
21
|
+
|
|
22
|
+
AudioContextOptions
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioDestinationGraphNode(): AudioNodeInit<AudioDestinationNode, AudioDestinationNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create an `AudioDestinationNode`
|
|
6
|
+
|
|
7
|
+
## Returns
|
|
8
|
+
|
|
9
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`AudioDestinationNode`, `AudioDestinationNode`\>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioGraph(initialConnections, options): AudioGraph;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Accepts AudioNodeInitConnections to build the audio graph within a signal audio context
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `initialConnections` | [`AudioNodeInitConnections`](../type-aliases/AudioNodeInitConnections.mdx) | A list of AudioNodeInit to build the graph in a linear fashion |
|
|
12
|
+
| `options` | [`AudioGraphOptions`](../interfaces/AudioGraphOptions.mdx) | |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`AudioGraph`](../interfaces/AudioGraph.mdx)
|
|
17
|
+
|
|
18
|
+
## See
|
|
19
|
+
|
|
20
|
+
[AudioGraphOptions](../interfaces/AudioGraphOptions.mdx)
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
const source = createStreamSourceGraphNode(stream);
|
|
26
|
+
const analyzer = createAnalyzerGraphNode({fftSize});
|
|
27
|
+
const audioGraph = createAudioGraph([[source, analyzer]]);
|
|
28
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioGraphProxy(audioGraph, handlers): AudioGraph;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `audioGraph` | [`AudioGraph`](../interfaces/AudioGraph.mdx) |
|
|
10
|
+
| `handlers` | `AudioGraphProxyHandlers` |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
[`AudioGraph`](../interfaces/AudioGraph.mdx)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioSignalDetector(shouldDetect, onDetected): (buffer, threshold?) => (samples) => void;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a function to process the AudioStats and check if silent
|
|
6
|
+
`onSignalDetected` callback is called under 2 situations:
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
Logic
|
|
10
|
+
lastCheck | silent | should call onSignalDetected
|
|
11
|
+
0 | 0 | 0
|
|
12
|
+
0 | 1 | 1
|
|
13
|
+
1 | 0 | 1
|
|
14
|
+
1 | 1 | 0
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type |
|
|
20
|
+
| ------ | ------ |
|
|
21
|
+
| `shouldDetect` | () => `boolean` |
|
|
22
|
+
| `onDetected` | (`silent`) => `void` |
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
(buffer, threshold?): (samples) => void;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------ | ------ |
|
|
34
|
+
| `buffer` | `Queue`\<`number`[]\> |
|
|
35
|
+
| `threshold?` | `number` |
|
|
36
|
+
|
|
37
|
+
### Returns
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
(samples): void;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
| Parameter | Type |
|
|
46
|
+
| ------ | ------ |
|
|
47
|
+
| `samples` | `number`[] |
|
|
48
|
+
|
|
49
|
+
#### Returns
|
|
50
|
+
|
|
51
|
+
`void`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createAudioStats(stats, options): AudioStats;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
AudioStats builder
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `stats` | `Partial`\<[`AudioStats`](../interfaces/AudioStats.mdx)\> | overwrite the default attributes |
|
|
12
|
+
| `options` | \{ `silentThreshold?`: `number`; `lowVolumeThreshold?`: `number`; `clipCountThreshold?`: `number`; \} | `silentThreshold`, `lowVolumeThreshold` and `clipCountThreshold` |
|
|
13
|
+
| `options.silentThreshold?` | `number` | - |
|
|
14
|
+
| `options.lowVolumeThreshold?` | `number` | - |
|
|
15
|
+
| `options.clipCountThreshold?` | `number` | - |
|
|
16
|
+
|
|
17
|
+
## Returns
|
|
18
|
+
|
|
19
|
+
[`AudioStats`](../interfaces/AudioStats.mdx)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createBenchmark(clock, options): Benchmark;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Creates a benchmarking utility for measuring frame durations and calculating frames per second (FPS).
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default value | Description |
|
|
10
|
+
| ------ | ------ | ------ | ------ |
|
|
11
|
+
| `clock` | [`Clock`](../interfaces/Clock.mdx) | `performance` | An object with a `now()` method returning the current timestamp (in milliseconds). Defaults to `window.performance`. |
|
|
12
|
+
| `options` | `BenchmarkOptions` | `{}` | Optional configuration options for the benchmark utility. |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`Benchmark`](../interfaces/Benchmark.mdx)
|
|
17
|
+
|
|
18
|
+
An object with methods to start/end frame measurements, reset the benchmark, and calculate current FPS.
|
|
19
|
+
|
|
20
|
+
## Remarks
|
|
21
|
+
|
|
22
|
+
This function is designed for performance measurement in animation or game loops.
|
|
23
|
+
It records frame start/end times, ignores an initial warmup period, utilizes a circular buffer
|
|
24
|
+
to average recent frame durations, and computes a smoothed FPS value on demand.
|
|
25
|
+
The calculation may only occur if sufficient samples have been gathered and the minimum interval between
|
|
26
|
+
calculations has elapsed.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createCanvas(width, height): HTMLCanvasElement;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a Canvas element with provided width and height
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `width` | `number` | canvas.width |
|
|
12
|
+
| `height` | `number` | canvas.height |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
`HTMLCanvasElement`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createCanvasTransform(segmenter, __namedParameters): Transform<InputFrame, InputFrame> & SegmentationParams & Pick<Segmenter, "update"> & Omit<Process, "open"> & object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `segmenter` | [`Segmenter`](../interfaces/Segmenter.mdx) |
|
|
10
|
+
| `__namedParameters` | `Partial`\<`Options`\> |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
[`Transform`](../interfaces/Transform.mdx)\<[`InputFrame`](../type-aliases/InputFrame.mdx), [`InputFrame`](../type-aliases/InputFrame.mdx)\> & [`SegmentationParams`](../interfaces/SegmentationParams.mdx) & `Pick`\<[`Segmenter`](../interfaces/Segmenter.mdx), `"update"`\> & `Omit`\<[`Process`](../interfaces/Process.mdx), `"open"`\> & `object`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createChannelMergerGraphNode(options?): AudioNodeInit<ChannelMergerNode, ChannelMergerNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a ChannelMergerNode
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `options?` | `ChannelMergerOptions` | |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`ChannelMergerNode`, `ChannelMergerNode`\>
|
|
16
|
+
|
|
17
|
+
## See
|
|
18
|
+
|
|
19
|
+
ChannelMergerOptions
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createChannelSplitterGraphNode(options?): AudioNodeInit<ChannelSplitterNode, ChannelSplitterNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a ChannelSplitterNode
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `options?` | `ChannelSplitterOptions` | |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`ChannelSplitterNode`, `ChannelSplitterNode`\>
|
|
16
|
+
|
|
17
|
+
## See
|
|
18
|
+
|
|
19
|
+
ChannelSplitterOptions
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createDelayGraphNode(options?): AudioNodeInit<DelayNode, DelayNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a `DelayNode`
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `options?` | `DelayOptions` | |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`DelayNode`, `DelayNode`\>
|
|
16
|
+
|
|
17
|
+
## See
|
|
18
|
+
|
|
19
|
+
DelayOptions
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createDenoiseWorkletGraphNode(data, messageHandler?): AudioNodeInit<AudioWorkletNode, AudioWorkletNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a noise suppression node
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `data` | `BufferSource` | WebAssembly source |
|
|
12
|
+
| `messageHandler?` | (`vads`) => `void` | - |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`AudioWorkletNode`, `AudioWorkletNode`\>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createFrameCallbackRequest(
|
|
3
|
+
callback,
|
|
4
|
+
frameRate,
|
|
5
|
+
__namedParameters): object;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Create a callback loop for video frame processing using
|
|
9
|
+
`requestVideoFrameCallback` under-the-hood when available otherwise our
|
|
10
|
+
fallback implementation based on `setTimeout`.
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| Parameter | Type | Description |
|
|
15
|
+
| ------ | ------ | ------ |
|
|
16
|
+
| `callback` | [`Callback`](../type-aliases/Callback.mdx)\<`Promise`\<`void`\>, \[[`ProcessInputType`](../type-aliases/ProcessInputType.mdx)\]\> | To be called by the loop |
|
|
17
|
+
| `frameRate` | `number` | A fallback frame rate when we are not able to get the rate from API |
|
|
18
|
+
| `__namedParameters` | `FrameCallbackRequestOptions` | - |
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
`object`
|
|
23
|
+
|
|
24
|
+
| Name | Type |
|
|
25
|
+
| ------ | ------ |
|
|
26
|
+
| `start()` | (`input`) => `Promise`\<`void`\> |
|
|
27
|
+
| `stop()` | () => `void` |
|
|
28
|
+
| `get frameRate` | `number` |
|
|
29
|
+
| `set frameRate` | `void` |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createGainGraphNode(mute): AudioNodeInit<GainNode, Gain>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a GainNodeInit
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `mute` | `boolean` | initial mute state |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`GainNode`, [`Gain`](../interfaces/Gain.mdx)\>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createMediaElementSourceGraphNode(mediaElement): AudioNodeInit<MediaElementAudioSourceNode, MediaElementAudioSourceNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a MediaStreamAudioSourceNodeInit
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `mediaElement` | `HTMLMediaElement` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`MediaElementAudioSourceNode`, `MediaElementAudioSourceNode`\>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createSegmenter(basePath, __namedParameters): Segmenter;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type | Default value | Description |
|
|
8
|
+
| ------ | ------ | ------ | ------ |
|
|
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
|
+
| `__namedParameters` | `Options` | `...` | - |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
[`Segmenter`](../interfaces/Segmenter.mdx)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createStreamDestinationGraphNode(options?): AudioNodeInit<MediaStreamAudioDestinationNode, MediaStreamAudioDestinationNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a MediaStreamAudioDestinationNodeInit
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `options?` | `AudioNodeOptions` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`MediaStreamAudioDestinationNode`, `MediaStreamAudioDestinationNode`\>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createStreamSourceGraphNode(mediaStream, shouldResetEnabled): AudioNodeInit<MediaStreamAudioSourceNode, MediaStreamAudioSourceNode>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Create a MediaStreamAudioSourceNodeInit
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default value | Description |
|
|
10
|
+
| ------ | ------ | ------ | ------ |
|
|
11
|
+
| `mediaStream` | `MediaStream` | `undefined` | Source MediaStream |
|
|
12
|
+
| `shouldResetEnabled` | `boolean` | `true` | Whether or not to enable the cloned track |
|
|
13
|
+
|
|
14
|
+
## Returns
|
|
15
|
+
|
|
16
|
+
[`AudioNodeInit`](../interfaces/AudioNodeInit.mdx)\<`MediaStreamAudioSourceNode`, `MediaStreamAudioSourceNode`\>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createVADetector(
|
|
3
|
+
onDetected,
|
|
4
|
+
shouldDetect,
|
|
5
|
+
options?): <T>(isVoice) => (data) => void;
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Create a voice detector based on provided params
|
|
9
|
+
|
|
10
|
+
## Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Description |
|
|
13
|
+
| ------ | ------ | ------ |
|
|
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
|
+
| `options?` | [`ThrottleOptions`](../interfaces/ThrottleOptions.mdx) | |
|
|
17
|
+
|
|
18
|
+
## Returns
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
<T>(isVoice): (data) => void;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Type Parameters
|
|
25
|
+
|
|
26
|
+
| Type Parameter |
|
|
27
|
+
| ------ |
|
|
28
|
+
| `T` |
|
|
29
|
+
|
|
30
|
+
### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------ | ------ |
|
|
34
|
+
| `isVoice` | [`IsVoice`](../type-aliases/IsVoice.mdx)\<`T`\> |
|
|
35
|
+
|
|
36
|
+
### Returns
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
(data): void;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
| Parameter | Type |
|
|
45
|
+
| ------ | ------ |
|
|
46
|
+
| `data` | `T` |
|
|
47
|
+
|
|
48
|
+
#### Returns
|
|
49
|
+
|
|
50
|
+
`void`
|
|
51
|
+
|
|
52
|
+
## See
|
|
53
|
+
|
|
54
|
+
ThrottleOptions
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createVideoProcessor(transformers, processTrack): VideoProcessor;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `transformers` | [`Transform`](../interfaces/Transform.mdx)\<[`InputFrame`](../type-aliases/InputFrame.mdx), [`InputFrame`](../type-aliases/InputFrame.mdx)\>[] |
|
|
10
|
+
| `processTrack` | [`ProcessVideoTrack`](../type-aliases/ProcessVideoTrack.mdx) |
|
|
11
|
+
|
|
12
|
+
## Returns
|
|
13
|
+
|
|
14
|
+
[`VideoProcessor`](../interfaces/VideoProcessor.mdx)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createVideoTrackProcessorWithFallback(__namedParameters): ProcessVideoTrack;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Video track processor using Canvas[captureStream] API
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type |
|
|
10
|
+
| ------ | ------ |
|
|
11
|
+
| `__namedParameters` | `FallbackOptions` |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`ProcessVideoTrack`](../type-aliases/ProcessVideoTrack.mdx)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createVoiceDetectorFromProbability(voiceThreshold): IsVoice<number>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
A function to check the provided probability is considered as voice activity
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Default value | Description |
|
|
10
|
+
| ------ | ------ | ------ | ------ |
|
|
11
|
+
| `voiceThreshold` | `number` | `VOICE_PROBABILITY_THRESHOLD` | A threshold of the probability to be considered as voice activity |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`IsVoice`](../type-aliases/IsVoice.mdx)\<`number`\>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createVoiceDetectorFromTimeData(options): IsVoice<number[]>;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
A function to check provided time series data is considered as voice activity
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `options` | `VAOptions` | |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`IsVoice`](../type-aliases/IsVoice.mdx)\<`number`[]\>
|
|
16
|
+
|
|
17
|
+
## See
|
|
18
|
+
|
|
19
|
+
VAOptions
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function createWindowedStats(windowSize): object;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
## Parameters
|
|
6
|
+
|
|
7
|
+
| Parameter | Type |
|
|
8
|
+
| ------ | ------ |
|
|
9
|
+
| `windowSize` | `number` |
|
|
10
|
+
|
|
11
|
+
## Returns
|
|
12
|
+
|
|
13
|
+
`object`
|
|
14
|
+
|
|
15
|
+
| Name | Type |
|
|
16
|
+
| ------ | ------ |
|
|
17
|
+
| `add()` | (`value`) => `void` |
|
|
18
|
+
| `get mean` | `number` |
|
|
19
|
+
| `get variance` | `number` |
|
|
20
|
+
| `get stddev` | `number` |
|
|
21
|
+
| `get stdError` | `number` |
|
|
22
|
+
| `get count` | `number` |
|
|
23
|
+
| `clear()` | () => `void` |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function fromByteToFloat(value): number;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Convert a byte to float, according to web audio spec
|
|
6
|
+
|
|
7
|
+
Floating point audio sample number is defined as: non-interleaved IEEE754
|
|
8
|
+
32-bit linear PCM with a nominal range between -1 and +1, that is, 32bits
|
|
9
|
+
floating point buffer, with each samples between -1.0 and 1.0
|
|
10
|
+
https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer
|
|
11
|
+
|
|
12
|
+
Byte samples are represented as follows:
|
|
13
|
+
128 is silence, 0 is negative max, 256 is positive max
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| ------ | ------ | ------ |
|
|
19
|
+
| `value` | `number` | The byte value to convert to float |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`number`
|
|
24
|
+
|
|
25
|
+
## Remarks
|
|
26
|
+
|
|
27
|
+
Ref. https://www.w3.org/TR/webaudio/#dom-analysernode-getbytetimedomaindata
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function fromFloatToByte(value): number;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Convert a float to byte, according to web audio spec
|
|
6
|
+
|
|
7
|
+
Floating point audio sample number is defined as: non-interleaved IEEE754
|
|
8
|
+
32-bit linear PCM with a nominal range between -1 and +1, that is, 32bits
|
|
9
|
+
floating point buffer, with each samples between -1.0 and 1.0
|
|
10
|
+
https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer
|
|
11
|
+
|
|
12
|
+
Byte samples are represented as follows:
|
|
13
|
+
128 is silence, 0 is negative max, 256 is positive max
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| ------ | ------ | ------ |
|
|
19
|
+
| `value` | `number` | The float value to convert to byte |
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`number`
|
|
24
|
+
|
|
25
|
+
## Remarks
|
|
26
|
+
|
|
27
|
+
Ref. https://www.w3.org/TR/webaudio/#dom-analysernode-getbytetimedomaindata
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```ts
|
|
2
|
+
function getAudioStats(options): AudioStats;
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
Calculate the audio stats, expected the samples are in float form
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
| Parameter | Type | Description |
|
|
10
|
+
| ------ | ------ | ------ |
|
|
11
|
+
| `options` | [`StatsOptions`](../interfaces/StatsOptions.mdx) | See StatsOptions |
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
[`AudioStats`](../interfaces/AudioStats.mdx)
|
|
16
|
+
|
|
17
|
+
## Remarks
|
|
18
|
+
|
|
19
|
+
http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing
|