@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.
Files changed (314) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/api-docs/README.mdx +438 -0
  3. package/api-docs/enumerations/AbortReason.mdx +5 -0
  4. package/api-docs/functions/avg.mdx +15 -0
  5. package/api-docs/functions/calculateDistance.mdx +18 -0
  6. package/api-docs/functions/closedCurve.mdx +27 -0
  7. package/api-docs/functions/copyByteBufferToFloatBuffer.mdx +16 -0
  8. package/api-docs/functions/createAnalyzerGraphNode.mdx +19 -0
  9. package/api-docs/functions/createAnalyzerSubscribableGraphNode.mdx +15 -0
  10. package/api-docs/functions/createAsyncCallbackLoop.mdx +35 -0
  11. package/api-docs/functions/createAudioContext.mdx +22 -0
  12. package/api-docs/functions/createAudioDestinationGraphNode.mdx +9 -0
  13. package/api-docs/functions/createAudioGraph.mdx +28 -0
  14. package/api-docs/functions/createAudioGraphProxy.mdx +14 -0
  15. package/api-docs/functions/createAudioSignalDetector.mdx +51 -0
  16. package/api-docs/functions/createAudioStats.mdx +19 -0
  17. package/api-docs/functions/createBenchmark.mdx +26 -0
  18. package/api-docs/functions/createCanvas.mdx +16 -0
  19. package/api-docs/functions/createCanvasTransform.mdx +14 -0
  20. package/api-docs/functions/createChannelMergerGraphNode.mdx +19 -0
  21. package/api-docs/functions/createChannelSplitterGraphNode.mdx +19 -0
  22. package/api-docs/functions/createDelayGraphNode.mdx +19 -0
  23. package/api-docs/functions/createDenoiseWorkletGraphNode.mdx +16 -0
  24. package/api-docs/functions/createFrameCallbackRequest.mdx +29 -0
  25. package/api-docs/functions/createGainGraphNode.mdx +15 -0
  26. package/api-docs/functions/createMediaElementSourceGraphNode.mdx +15 -0
  27. package/api-docs/functions/createSegmenter.mdx +14 -0
  28. package/api-docs/functions/createStreamDestinationGraphNode.mdx +15 -0
  29. package/api-docs/functions/createStreamSourceGraphNode.mdx +16 -0
  30. package/api-docs/functions/createVADetector.mdx +54 -0
  31. package/api-docs/functions/createVideoProcessor.mdx +14 -0
  32. package/api-docs/functions/createVideoTrackProcessor.mdx +9 -0
  33. package/api-docs/functions/createVideoTrackProcessorWithFallback.mdx +15 -0
  34. package/api-docs/functions/createVoiceDetectorFromProbability.mdx +15 -0
  35. package/api-docs/functions/createVoiceDetectorFromTimeData.mdx +19 -0
  36. package/api-docs/functions/createWindowedStats.mdx +23 -0
  37. package/api-docs/functions/curve.mdx +15 -0
  38. package/api-docs/functions/fromByteToFloat.mdx +27 -0
  39. package/api-docs/functions/fromFloatToByte.mdx +27 -0
  40. package/api-docs/functions/getAudioStats.mdx +19 -0
  41. package/api-docs/functions/getBezierCurveControlPoints.mdx +26 -0
  42. package/api-docs/functions/iou.mdx +19 -0
  43. package/api-docs/functions/isAnalyzerNodeInit.mdx +13 -0
  44. package/api-docs/functions/isAudioNode.mdx +13 -0
  45. package/api-docs/functions/isAudioNodeInit.mdx +13 -0
  46. package/api-docs/functions/isAudioParam.mdx +13 -0
  47. package/api-docs/functions/isClipping.mdx +18 -0
  48. package/api-docs/functions/isEqualSize.mdx +22 -0
  49. package/api-docs/functions/isLowVolume.mdx +19 -0
  50. package/api-docs/functions/isMono.mdx +22 -0
  51. package/api-docs/functions/isRenderEffects.mdx +13 -0
  52. package/api-docs/functions/isSilent.mdx +22 -0
  53. package/api-docs/functions/isVoiceActivity.mdx +29 -0
  54. package/api-docs/functions/labelComponents.mdx +20 -0
  55. package/api-docs/functions/line.mdx +15 -0
  56. package/api-docs/functions/loadScript.mdx +14 -0
  57. package/api-docs/functions/loadWasms.mdx +13 -0
  58. package/api-docs/functions/nearestPowerOfTwo.mdx +21 -0
  59. package/api-docs/functions/playVideo.mdx +16 -0
  60. package/api-docs/functions/pow.mdx +29 -0
  61. package/api-docs/functions/processAverageVolume.mdx +15 -0
  62. package/api-docs/functions/resumeAudioOnInterruption.mdx +23 -0
  63. package/api-docs/functions/resumeAudioOnUnmute.mdx +27 -0
  64. package/api-docs/functions/rms.mdx +15 -0
  65. package/api-docs/functions/round.mdx +23 -0
  66. package/api-docs/functions/scoreComponent.mdx +22 -0
  67. package/api-docs/functions/setVideoElementSrc.mdx +14 -0
  68. package/api-docs/functions/subscribeTimeoutAnalyzerNode.mdx +22 -0
  69. package/api-docs/functions/subscribeWorkletNode.mdx +28 -0
  70. package/api-docs/functions/sum.mdx +15 -0
  71. package/api-docs/functions/toDecibel.mdx +18 -0
  72. package/api-docs/interfaces/Analyzer.mdx +368 -0
  73. package/api-docs/interfaces/AnalyzerSubscribableOptions.mdx +11 -0
  74. package/api-docs/interfaces/AsyncAssets.mdx +7 -0
  75. package/api-docs/interfaces/AudioGraph.mdx +92 -0
  76. package/api-docs/interfaces/AudioGraphOptions.mdx +6 -0
  77. package/api-docs/interfaces/AudioNodeInit.mdx +127 -0
  78. package/api-docs/interfaces/AudioNodeProps.mdx +15 -0
  79. package/api-docs/interfaces/AudioStats.mdx +16 -0
  80. package/api-docs/interfaces/BackgroundImage.mdx +6 -0
  81. package/api-docs/interfaces/Benchmark.mdx +47 -0
  82. package/api-docs/interfaces/Clock.mdx +11 -0
  83. package/api-docs/interfaces/Denoise.mdx +50 -0
  84. package/api-docs/interfaces/Detector.mdx +81 -0
  85. package/api-docs/interfaces/Frame.mdx +11 -0
  86. package/api-docs/interfaces/Gain.mdx +227 -0
  87. package/api-docs/interfaces/ImageRecord.mdx +6 -0
  88. package/api-docs/interfaces/ImageSegmenterOptions.mdx +8 -0
  89. package/api-docs/interfaces/MPMask.mdx +145 -0
  90. package/api-docs/interfaces/Point.mdx +10 -0
  91. package/api-docs/interfaces/Process.mdx +46 -0
  92. package/api-docs/interfaces/ProcessEventClose.mdx +7 -0
  93. package/api-docs/interfaces/ProcessEventDebug.mdx +14 -0
  94. package/api-docs/interfaces/ProcessEventDestroy.mdx +7 -0
  95. package/api-docs/interfaces/ProcessEventOpen.mdx +14 -0
  96. package/api-docs/interfaces/ProcessEventProcess.mdx +14 -0
  97. package/api-docs/interfaces/ProcessEventUpdate.mdx +14 -0
  98. package/api-docs/interfaces/ProcessWorkerDebugMessage.mdx +6 -0
  99. package/api-docs/interfaces/ProcessWorkerEvent.mdx +12 -0
  100. package/api-docs/interfaces/ProcessWorkerEventDebug.mdx +12 -0
  101. package/api-docs/interfaces/ProcessWorkerEventOpened.mdx +5 -0
  102. package/api-docs/interfaces/ProcessWorkerEventProcessed.mdx +12 -0
  103. package/api-docs/interfaces/ProcessWorkerEventUpdated.mdx +5 -0
  104. package/api-docs/interfaces/ProcessorEvent.mdx +7 -0
  105. package/api-docs/interfaces/ProcessorOptions.mdx +16 -0
  106. package/api-docs/interfaces/ProcessorProcessOptions.mdx +6 -0
  107. package/api-docs/interfaces/Rect.mdx +8 -0
  108. package/api-docs/interfaces/RenderEventHandlers.mdx +7 -0
  109. package/api-docs/interfaces/Renderer.mdx +64 -0
  110. package/api-docs/interfaces/RendererOptions.mdx +32 -0
  111. package/api-docs/interfaces/Runner.mdx +41 -0
  112. package/api-docs/interfaces/Segmentation.mdx +5 -0
  113. package/api-docs/interfaces/SegmentationModelAsset.mdx +8 -0
  114. package/api-docs/interfaces/SegmentationParams.mdx +35 -0
  115. package/api-docs/interfaces/SegmentationSmoothingConfig.mdx +5 -0
  116. package/api-docs/interfaces/Segmenter.mdx +121 -0
  117. package/api-docs/interfaces/SegmenterOptions.mdx +13 -0
  118. package/api-docs/interfaces/SelectionOptions.mdx +15 -0
  119. package/api-docs/interfaces/Size.mdx +10 -0
  120. package/api-docs/interfaces/Stats.mdx +11 -0
  121. package/api-docs/interfaces/StatsOptions.mdx +10 -0
  122. package/api-docs/interfaces/SubscribableOptions.mdx +9 -0
  123. package/api-docs/interfaces/ThrottleOptions.mdx +8 -0
  124. package/api-docs/interfaces/Transform.mdx +62 -0
  125. package/api-docs/interfaces/VideoFrameLike.mdx +8 -0
  126. package/api-docs/interfaces/VideoProcessor.mdx +38 -0
  127. package/api-docs/interfaces/Weights.mdx +12 -0
  128. package/api-docs/interfaces/WorkletMessagePortOptions.mdx +16 -0
  129. package/api-docs/interfaces/WorkletModule.mdx +6 -0
  130. package/api-docs/type-aliases/AnalyzerNodeInit.mdx +3 -0
  131. package/api-docs/type-aliases/AsyncCallback.mdx +7 -0
  132. package/api-docs/type-aliases/AudioBufferBytes.mdx +5 -0
  133. package/api-docs/type-aliases/AudioBufferFloats.mdx +6 -0
  134. package/api-docs/type-aliases/AudioDestinationNodeInit.mdx +3 -0
  135. package/api-docs/type-aliases/AudioNodeConnectParam.mdx +3 -0
  136. package/api-docs/type-aliases/AudioNodeInitConnectParam.mdx +3 -0
  137. package/api-docs/type-aliases/AudioNodeInitConnection.mdx +3 -0
  138. package/api-docs/type-aliases/AudioNodeInitConnections.mdx +3 -0
  139. package/api-docs/type-aliases/AudioNodeParam.mdx +3 -0
  140. package/api-docs/type-aliases/AudioSamples.mdx +17 -0
  141. package/api-docs/type-aliases/BaseAudioNode.mdx +3 -0
  142. package/api-docs/type-aliases/Callback.mdx +20 -0
  143. package/api-docs/type-aliases/Canvas.mdx +3 -0
  144. package/api-docs/type-aliases/CanvasContext.mdx +3 -0
  145. package/api-docs/type-aliases/ChannelSplitterNodeInit.mdx +3 -0
  146. package/api-docs/type-aliases/Color.mdx +12 -0
  147. package/api-docs/type-aliases/ConnectInitParamBaseType.mdx +3 -0
  148. package/api-docs/type-aliases/ConnectInitParamType.mdx +3 -0
  149. package/api-docs/type-aliases/ConnectParamBase.mdx +11 -0
  150. package/api-docs/type-aliases/ConnectParamBaseType.mdx +3 -0
  151. package/api-docs/type-aliases/ConnectParamType.mdx +3 -0
  152. package/api-docs/type-aliases/DelayNodeInit.mdx +3 -0
  153. package/api-docs/type-aliases/Delegate.mdx +3 -0
  154. package/api-docs/type-aliases/DenoiseWorkletNodeInit.mdx +3 -0
  155. package/api-docs/type-aliases/ExtractMessageEventType.mdx +9 -0
  156. package/api-docs/type-aliases/GainNodeInit.mdx +3 -0
  157. package/api-docs/type-aliases/ImageMapIterable.mdx +3 -0
  158. package/api-docs/type-aliases/ImageType.mdx +6 -0
  159. package/api-docs/type-aliases/IncludeMessageEventDataType.mdx +10 -0
  160. package/api-docs/type-aliases/InputFrame.mdx +3 -0
  161. package/api-docs/type-aliases/IsVoice.mdx +19 -0
  162. package/api-docs/type-aliases/MediaElementAudioSourceNodeInit.mdx +3 -0
  163. package/api-docs/type-aliases/MediaStreamAudioDestinationNodeInit.mdx +3 -0
  164. package/api-docs/type-aliases/MediaStreamAudioSourceNodeInit.mdx +3 -0
  165. package/api-docs/type-aliases/Node.mdx +3 -0
  166. package/api-docs/type-aliases/NodeConnectionAction.mdx +3 -0
  167. package/api-docs/type-aliases/Nodes.mdx +3 -0
  168. package/api-docs/type-aliases/OptionalKeys.mdx +10 -0
  169. package/api-docs/type-aliases/ProcessEvents.mdx +17 -0
  170. package/api-docs/type-aliases/ProcessInputType.mdx +3 -0
  171. package/api-docs/type-aliases/ProcessStatus.mdx +3 -0
  172. package/api-docs/type-aliases/ProcessVideoTrack.mdx +15 -0
  173. package/api-docs/type-aliases/ProcessWorkerEvents.mdx +18 -0
  174. package/api-docs/type-aliases/ProcessorEvents.mdx +3 -0
  175. package/api-docs/type-aliases/ProcessorWorkerEvents.mdx +3 -0
  176. package/api-docs/type-aliases/RenderBackend.mdx +3 -0
  177. package/api-docs/type-aliases/RenderEffects.mdx +3 -0
  178. package/api-docs/type-aliases/RenderingEvents.mdx +3 -0
  179. package/api-docs/type-aliases/RunnerCreator.mdx +21 -0
  180. package/api-docs/type-aliases/SegmentationModel.mdx +3 -0
  181. package/api-docs/type-aliases/SegmentationTransform.mdx +3 -0
  182. package/api-docs/type-aliases/TupleOf.mdx +12 -0
  183. package/api-docs/type-aliases/UniversalAudioContextState.mdx +6 -0
  184. package/api-docs/type-aliases/Unsubscribe.mdx +9 -0
  185. package/api-docs/type-aliases/WasmPaths.mdx +3 -0
  186. package/api-docs/variables/BACKGROUND_BLUR_AMOUNT.mdx +3 -0
  187. package/api-docs/variables/BACKGROUND_THRESHOLD.mdx +3 -0
  188. package/api-docs/variables/CLIP_COUNT_THRESHOLD.mdx +6 -0
  189. package/api-docs/variables/CLIP_THRESHOLD.mdx +5 -0
  190. package/api-docs/variables/DOWN_SAMPLE_FACTOR.mdx +3 -0
  191. package/api-docs/variables/EDGE_BLUR_AMOUNT.mdx +3 -0
  192. package/api-docs/variables/EXCLUDE_BYSTANDERS.mdx +3 -0
  193. package/api-docs/variables/FOREGROUND_THRESHOLD.mdx +3 -0
  194. package/api-docs/variables/FRAME_RATE.mdx +3 -0
  195. package/api-docs/variables/LIGHT_WRAP_BLUR_AMOUNT.mdx +3 -0
  196. package/api-docs/variables/LIGHT_WRAP_EDGE_BAND.mdx +3 -0
  197. package/api-docs/variables/LIGHT_WRAP_INTENSITY.mdx +3 -0
  198. package/api-docs/variables/LIGHT_WRAP_TIGHTNESS.mdx +3 -0
  199. package/api-docs/variables/LOW_VOLUME_THRESHOLD.mdx +5 -0
  200. package/api-docs/variables/MASK_COMBINE_RATIO.mdx +3 -0
  201. package/api-docs/variables/MONO_THRESHOLD.mdx +6 -0
  202. package/api-docs/variables/MORPH_DILATE_RADIUS_PX.mdx +3 -0
  203. package/api-docs/variables/MORPH_ERODE_RADIUS_PX.mdx +3 -0
  204. package/api-docs/variables/MORPH_PASS.mdx +3 -0
  205. package/api-docs/variables/PERSON_CENTER.mdx +3 -0
  206. package/api-docs/variables/PLAY_VIDEO_TIMEOUT.mdx +3 -0
  207. package/api-docs/variables/PROCESSING_HEIGHT.mdx +3 -0
  208. package/api-docs/variables/PROCESSING_WIDTH.mdx +3 -0
  209. package/api-docs/variables/PROCESS_STATUS.mdx +22 -0
  210. package/api-docs/variables/RENDERING_EVENTS.mdx +14 -0
  211. package/api-docs/variables/RENDER_BACKEND.mdx +10 -0
  212. package/api-docs/variables/RENDER_EFFECT.mdx +11 -0
  213. package/api-docs/variables/SEGMENTATION_MODELS.mdx +10 -0
  214. package/api-docs/variables/SIGMA_RANGE.mdx +3 -0
  215. package/api-docs/variables/SIGMA_SPACE.mdx +3 -0
  216. package/api-docs/variables/SILENT_THRESHOLD.mdx +6 -0
  217. package/api-docs/variables/STRONG_EDGE_BLUR_AMOUNT.mdx +3 -0
  218. package/api-docs/variables/VOICE_PROBABILITY_THRESHOLD.mdx +5 -0
  219. package/api-docs/variables/calculateMaxBlurPass.mdx +13 -0
  220. package/api-docs/variables/clamping.mdx +26 -0
  221. package/api-docs/variables/createLazyProps.mdx +19 -0
  222. package/api-docs/variables/createObjectUpdater.mdx +31 -0
  223. package/api-docs/variables/createRemoteImageBitmap.mdx +21 -0
  224. package/api-docs/variables/getCanvasRenderingContext2D.mdx +14 -0
  225. package/api-docs/variables/getErrorMessage.mdx +13 -0
  226. package/api-docs/variables/getImageSize.mdx +13 -0
  227. package/api-docs/variables/handleWebGLContextLoss.mdx +21 -0
  228. package/api-docs/variables/isRenderingEvents.mdx +13 -0
  229. package/api-docs/variables/isSegmentationModel.mdx +13 -0
  230. package/api-docs/variables/resize.mdx +30 -0
  231. package/api-docs/variables/toRenderingEvents.mdx +13 -0
  232. package/api-docs/variables/urls.mdx +10 -0
  233. package/dist/common/backends/webgl/binaryMask.d.ts +8 -0
  234. package/dist/common/backends/webgl/binaryMask.js +95 -0
  235. package/dist/common/backends/webgl/blender.d.ts +2 -1
  236. package/dist/common/backends/webgl/blender.js +18 -15
  237. package/dist/common/backends/webgl/blur.d.ts +1 -1
  238. package/dist/common/backends/webgl/blur.js +23 -16
  239. package/dist/common/backends/webgl/canvas.js +9 -4
  240. package/dist/common/backends/webgl/diffAbsMask.d.ts +10 -0
  241. package/dist/common/backends/webgl/diffAbsMask.js +103 -0
  242. package/dist/common/backends/webgl/geodesicReconstruction.d.ts +13 -0
  243. package/dist/common/backends/webgl/geodesicReconstruction.js +176 -0
  244. package/dist/common/backends/webgl/jointBilateralFilter.d.ts +12 -0
  245. package/dist/common/backends/webgl/jointBilateralFilter.js +108 -0
  246. package/dist/common/backends/webgl/morphErode.d.ts +13 -0
  247. package/dist/common/backends/webgl/morphErode.js +121 -0
  248. package/dist/common/backends/webgl/renderer.js +194 -34
  249. package/dist/common/backends/webgl/replace.d.ts +17 -0
  250. package/dist/common/backends/webgl/replace.js +126 -0
  251. package/dist/common/backends/webgl/selectComponent.d.ts +15 -0
  252. package/dist/common/backends/webgl/selectComponent.js +102 -0
  253. package/dist/common/backends/webgl/smoothingMask.d.ts +3 -3
  254. package/dist/common/backends/webgl/smoothingMask.js +22 -21
  255. package/dist/common/backends/webgl/tentBlur.d.ts +9 -0
  256. package/dist/common/backends/webgl/tentBlur.js +118 -0
  257. package/dist/common/backends/webgl/texture.d.ts +1 -1
  258. package/dist/common/backends/webgl/texture.js +19 -17
  259. package/dist/common/backends/webgl/textureToTexture.d.ts +1 -1
  260. package/dist/common/backends/webgl/textureToTexture.js +19 -16
  261. package/dist/common/backends/webgl/webglUtils.d.ts +7 -1
  262. package/dist/common/backends/webgl/webglUtils.js +64 -6
  263. package/dist/common/backends/webgpu/blender.d.ts +6 -1
  264. package/dist/common/backends/webgpu/blender.js +96 -51
  265. package/dist/common/backends/webgpu/constants.js +1 -1
  266. package/dist/common/backends/webgpu/dualFilterBlur.d.ts +2 -3
  267. package/dist/common/backends/webgpu/dualFilterBlur.js +146 -140
  268. package/dist/common/backends/webgpu/jointBilateralFilter.d.ts +7 -0
  269. package/dist/common/backends/webgpu/jointBilateralFilter.js +162 -0
  270. package/dist/common/backends/webgpu/renderer.js +211 -39
  271. package/dist/common/backends/webgpu/replace.d.ts +11 -0
  272. package/dist/common/backends/webgpu/replace.js +175 -0
  273. package/dist/common/backends/webgpu/resize.d.ts +4 -0
  274. package/dist/common/backends/webgpu/resize.js +76 -0
  275. package/dist/common/backends/webgpu/smoothingMask.d.ts +2 -2
  276. package/dist/common/backends/webgpu/smoothingMask.js +74 -40
  277. package/dist/common/backends/webgpu/tentBlur.d.ts +5 -0
  278. package/dist/common/backends/webgpu/tentBlur.js +131 -0
  279. package/dist/common/backends/webgpu/texture.d.ts +2 -2
  280. package/dist/common/backends/webgpu/texture.js +24 -19
  281. package/dist/common/backends/webgpu/textureToTexture.d.ts +1 -1
  282. package/dist/common/backends/webgpu/textureToTexture.js +28 -15
  283. package/dist/common/backends/webgpu/types.d.ts +2 -0
  284. package/dist/common/backends/webgpu/webgpuUtils.d.ts +24 -4
  285. package/dist/common/backends/webgpu/webgpuUtils.js +60 -11
  286. package/dist/common/constants.d.ts +19 -5
  287. package/dist/common/constants.js +19 -5
  288. package/dist/common/index.d.ts +1 -0
  289. package/dist/common/index.js +1 -0
  290. package/dist/common/tsconfig.tsbuildinfo +1 -1
  291. package/dist/common/types/render.d.ts +142 -13
  292. package/dist/common/types/utils.d.ts +21 -0
  293. package/dist/common/utils.d.ts +16 -0
  294. package/dist/common/utils.js +152 -0
  295. package/dist/main/benchUtils.d.ts +33 -1
  296. package/dist/main/benchUtils.js +145 -11
  297. package/dist/main/tsconfig.tsbuildinfo +1 -1
  298. package/dist/main/video/canvasTransform.d.ts +1 -1
  299. package/dist/main/video/canvasTransform.js +135 -47
  300. package/dist/main/video/index.d.ts +1 -1
  301. package/dist/main/video/index.js +1 -1
  302. package/dist/workers/mediaWorker.js +35 -162
  303. package/dist/workers/tsconfig.tsbuildinfo +1 -1
  304. package/package.json +16 -10
  305. package/dist/common/backends/webgl/shaders/blendFragmentShader.d.ts +0 -1
  306. package/dist/common/backends/webgl/shaders/blendFragmentShader.js +0 -21
  307. package/dist/common/backends/webgl/shaders/dualFilterBlurFragmentShader.d.ts +0 -1
  308. package/dist/common/backends/webgl/shaders/dualFilterBlurFragmentShader.js +0 -45
  309. package/dist/common/backends/webgl/shaders/smoothingMaskFragmentShader.d.ts +0 -1
  310. package/dist/common/backends/webgl/shaders/smoothingMaskFragmentShader.js +0 -57
  311. package/dist/common/backends/webgl/shaders/textureFragmentShader.d.ts +0 -1
  312. package/dist/common/backends/webgl/shaders/textureFragmentShader.js +0 -16
  313. package/dist/common/backends/webgl/shaders/vertexShader.d.ts +0 -1
  314. package/dist/common/backends/webgl/shaders/vertexShader.js +0 -19
@@ -0,0 +1,5 @@
1
+ ```ts
2
+ type AudioBufferBytes = Uint8Array;
3
+ ```
4
+
5
+ Same as the return from [AnalyserNode.getByteFrequencyData()](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData)
@@ -0,0 +1,6 @@
1
+ ```ts
2
+ type AudioBufferFloats = Float32Array;
3
+ ```
4
+
5
+ Same as [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
6
+ Or the return from [AnalyserNode.getFloatFrequencyData()](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getFloatFrequencyData)
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioDestinationNodeInit = AudioNodeInit<AudioDestinationNode, AudioDestinationNode>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioNodeConnectParam = ConnectParamBase<ConnectParamType>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioNodeInitConnectParam = ConnectParamBase<ConnectInitParamType>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioNodeInitConnection = AudioNodeInitConnectParam[];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioNodeInitConnections = AudioNodeInitConnection[];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type AudioNodeParam = BaseAudioNode | AudioParam;
3
+ ```
@@ -0,0 +1,17 @@
1
+ ```ts
2
+ type AudioSamples =
3
+ | number[]
4
+ | AudioBufferFloats
5
+ | AudioBufferBytes;
6
+ ```
7
+
8
+ Audio samples from each channel, either in float or bytes form
9
+
10
+ ## Example
11
+
12
+ ```
13
+ | | | Sample Frame 1 | Sample Frame 2 | Sample Frame 3 |
14
+ | Input | Channel L: | sample 1 | sample 2 | sample 3 |
15
+ | | Channel R: | sample 1 | sample 2 | sample 3 |
16
+ ```
17
+ We can get 2 `AudioSamples` from "Channel L" and "Channel R" from "Input"
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type BaseAudioNode = Pick<AudioNode, NodeConnectionAction>;
3
+ ```
@@ -0,0 +1,20 @@
1
+ ```ts
2
+ type Callback<R, T> = (...params) => R;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `R` |
10
+ | `T` *extends* `unknown`[] |
11
+
12
+ ## Parameters
13
+
14
+ | Parameter | Type |
15
+ | ------ | ------ |
16
+ | ...`params` | `T` |
17
+
18
+ ## Returns
19
+
20
+ `R`
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type Canvas = HTMLCanvasElement | OffscreenCanvas;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type CanvasContext = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ChannelSplitterNodeInit = AudioNodeInit<ChannelSplitterNode, ChannelSplitterNode>;
3
+ ```
@@ -0,0 +1,12 @@
1
+ ```ts
2
+ type Color = object;
3
+ ```
4
+
5
+ ## Properties
6
+
7
+ | Property | Type |
8
+ | ------ | ------ |
9
+ | <a id="r"></a> `r` | `number` |
10
+ | <a id="g"></a> `g` | `number` |
11
+ | <a id="b"></a> `b` | `number` |
12
+ | <a id="a"></a> `a` | `number` |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ConnectInitParamBaseType = AudioParam | AudioNodeInit;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ConnectInitParamType = ConnectInitParamBaseType | undefined;
3
+ ```
@@ -0,0 +1,11 @@
1
+ ```ts
2
+ type ConnectParamBase<T> =
3
+ | [T, T extends undefined ? undefined : AudioNodeOutputIndex, T extends undefined ? undefined : AudioNodeInputIndex]
4
+ | T;
5
+ ```
6
+
7
+ ## Type Parameters
8
+
9
+ | Type Parameter |
10
+ | ------ |
11
+ | `T` *extends* \| [`ConnectParamType`](ConnectParamType.mdx) \| [`ConnectInitParamType`](ConnectInitParamType.mdx) |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ConnectParamBaseType = AudioParam | BaseAudioNode;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ConnectParamType = ConnectParamBaseType | undefined;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type DelayNodeInit = AudioNodeInit<DelayNode, DelayNode>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type Delegate = "CPU" | "GPU" | undefined;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type DenoiseWorkletNodeInit = AudioNodeInit<AudioWorkletNode>;
3
+ ```
@@ -0,0 +1,9 @@
1
+ ```ts
2
+ type ExtractMessageEventType<T> = T extends object ? O : never;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `T` *extends* `object` |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type GainNodeInit = AudioNodeInit<GainNode, Gain>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ImageMapIterable = Iterable<readonly [string, ImageBitmap]>;
3
+ ```
@@ -0,0 +1,6 @@
1
+ ```ts
2
+ type ImageType =
3
+ | CanvasImageSource
4
+ | ProcessInputType
5
+ | VideoFrame;
6
+ ```
@@ -0,0 +1,10 @@
1
+ ```ts
2
+ type IncludeMessageEventDataType<E, I> = E extends object ? A extends I ? D : never : E extends object ? B extends I ? void : never : never;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `E` *extends* `object` |
10
+ | `I` |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type InputFrame = HTMLCanvasElement | OffscreenCanvas | VideoFrame | ImageBitmap;
3
+ ```
@@ -0,0 +1,19 @@
1
+ ```ts
2
+ type IsVoice<T> = (data) => boolean;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `T` |
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type |
14
+ | ------ | ------ |
15
+ | `data` | `T` |
16
+
17
+ ## Returns
18
+
19
+ `boolean`
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type MediaElementAudioSourceNodeInit = AudioNodeInit<MediaElementAudioSourceNode, MediaElementAudioSourceNode>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type MediaStreamAudioDestinationNodeInit = AudioNodeInit<MediaStreamAudioDestinationNode, MediaStreamAudioDestinationNode>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type MediaStreamAudioSourceNodeInit = AudioNodeInit<MediaStreamAudioSourceNode, MediaStreamAudioSourceNode>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type Node = AudioNode | AudioParam;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type NodeConnectionAction = "connect" | "disconnect";
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type Nodes = Node[];
3
+ ```
@@ -0,0 +1,10 @@
1
+ ```ts
2
+ type OptionalKeys<T, K> = Omit<T, K> & Partial<Pick<T, K>>;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `T` |
10
+ | `K` *extends* keyof `T` |
@@ -0,0 +1,17 @@
1
+ ```ts
2
+ type ProcessEvents<T, I> =
3
+ | ProcessEventOpen<T>
4
+ | ProcessEventProcess<I>
5
+ | ProcessEventUpdate<T>
6
+ | ProcessEventClose
7
+ | ProcessEventDestroy;
8
+ ```
9
+
10
+ Message events to be sent to the Processor
11
+
12
+ ## Type Parameters
13
+
14
+ | Type Parameter |
15
+ | ------ |
16
+ | `T` |
17
+ | `I` |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ProcessInputType = VideoFrame | ImageData | OffscreenCanvas | ImageBitmap;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ProcessStatus = ExtractValueTypes<typeof PROCESS_STATUS>;
3
+ ```
@@ -0,0 +1,15 @@
1
+ ```ts
2
+ type ProcessVideoTrack = (track, transformers, options?) => Promise<Track>;
3
+ ```
4
+
5
+ ## Parameters
6
+
7
+ | Parameter | Type |
8
+ | ------ | ------ |
9
+ | `track` | `MediaStreamVideoTrack` |
10
+ | `transformers` | `Transformer`\<[`InputFrame`](InputFrame.mdx), [`InputFrame`](InputFrame.mdx)\>[] |
11
+ | `options?` | `Options` |
12
+
13
+ ## Returns
14
+
15
+ `Promise`\<`Track`\>
@@ -0,0 +1,18 @@
1
+ ```ts
2
+ type ProcessWorkerEvents<T, E, D> =
3
+ | ProcessWorkerEventProcessed<T>
4
+ | ProcessWorkerEventOpened
5
+ | ProcessWorkerEventUpdated
6
+ | ProcessWorkerEvent<E>
7
+ | ProcessWorkerEventDebug<D>;
8
+ ```
9
+
10
+ Message events returned from the processor
11
+
12
+ ## Type Parameters
13
+
14
+ | Type Parameter |
15
+ | ------ |
16
+ | `T` |
17
+ | `E` |
18
+ | `D` |
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ProcessorEvents = ProcessEvents<ProcessorOptions, ProcessorProcessOptions>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type ProcessorWorkerEvents = ProcessWorkerEvents<VideoFrameLike, ProcessorEvent, ProcessWorkerDebugMessage>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type RenderBackend = ExtractValueTypes<typeof RENDER_BACKEND>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type RenderEffects = ExtractValueTypes<typeof RENDER_EFFECT>;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type RenderingEvents = ExtractValueTypes<typeof RENDERING_EVENTS>;
3
+ ```
@@ -0,0 +1,21 @@
1
+ ```ts
2
+ type RunnerCreator<P, R> = (callback, frameRate) => Runner<P>;
3
+ ```
4
+
5
+ ## Type Parameters
6
+
7
+ | Type Parameter |
8
+ | ------ |
9
+ | `P` *extends* `unknown`[] |
10
+ | `R` |
11
+
12
+ ## Parameters
13
+
14
+ | Parameter | Type |
15
+ | ------ | ------ |
16
+ | `callback` | [`Callback`](Callback.mdx)\<`R`, `P`\> |
17
+ | `frameRate` | `number` |
18
+
19
+ ## Returns
20
+
21
+ [`Runner`](../interfaces/Runner.mdx)\<`P`\>
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type SegmentationModel = typeof SEGMENTATION_MODELS[keyof typeof SEGMENTATION_MODELS];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type SegmentationTransform = Transform<InputFrame, InputFrame> & SegmentationParams & Pick<Segmenter, "update"> & Omit<Process, "open">;
3
+ ```
@@ -0,0 +1,12 @@
1
+ ```ts
2
+ type TupleOf<T, N> = N extends N ? number extends N ? T[] : _TupleOf<T, N, []> : never;
3
+ ```
4
+
5
+ From https://github.com/Microsoft/TypeScript/issues/26223#issuecomment-674500430
6
+
7
+ ## Type Parameters
8
+
9
+ | Type Parameter |
10
+ | ------ |
11
+ | `T` |
12
+ | `N` *extends* `number` |
@@ -0,0 +1,6 @@
1
+ ```ts
2
+ type UniversalAudioContextState = AudioContextState | "interrupted";
3
+ ```
4
+
5
+ We need to add the missing type def to work with AudioContextState in Safari
6
+ See https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/state#resuming_interrupted_play_states_in_ios_safari
@@ -0,0 +1,9 @@
1
+ ```ts
2
+ type Unsubscribe = () => void;
3
+ ```
4
+
5
+ Unsubscribe the subscription
6
+
7
+ ## Returns
8
+
9
+ `void`
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ type WasmPaths = [string, string | undefined];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const BACKGROUND_BLUR_AMOUNT: 3 = 3;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const BACKGROUND_THRESHOLD: 0.35 = 0.35;
3
+ ```
@@ -0,0 +1,6 @@
1
+ ```ts
2
+ const CLIP_COUNT_THRESHOLD: 6 = 6.0;
3
+ ```
4
+
5
+ Default clipping count threshold
6
+ Number of consecutive clipThreshold level samples that indicate clipping.
@@ -0,0 +1,5 @@
1
+ ```ts
2
+ const CLIP_THRESHOLD: 0.98 = 0.98;
3
+ ```
4
+
5
+ Default clipping detection threshold
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const DOWN_SAMPLE_FACTOR: 2 = 2;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const EDGE_BLUR_AMOUNT: 4 = 4;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const EXCLUDE_BYSTANDERS: false = false;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const FOREGROUND_THRESHOLD: 0.85 = 0.85;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const FRAME_RATE: 20 = 20;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const LIGHT_WRAP_BLUR_AMOUNT: 1 = 1;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const LIGHT_WRAP_EDGE_BAND: 0.25 = 0.25;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const LIGHT_WRAP_INTENSITY: 0.8 = 0.8;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const LIGHT_WRAP_TIGHTNESS: 1 = 1;
3
+ ```
@@ -0,0 +1,5 @@
1
+ ```ts
2
+ const LOW_VOLUME_THRESHOLD: -60 = -60;
3
+ ```
4
+
5
+ Default low volume detection threshold
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const MASK_COMBINE_RATIO: 0.8 = 0.8;
3
+ ```
@@ -0,0 +1,6 @@
1
+ ```ts
2
+ const MONO_THRESHOLD: number;
3
+ ```
4
+
5
+ Default mono detection threshold
6
+ Data must be identical within one LSB 16-bit to be identified as mono.
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const MORPH_DILATE_RADIUS_PX: 6 = 6;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const MORPH_ERODE_RADIUS_PX: 5 = 5;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const MORPH_PASS: 4 = 4;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const PERSON_CENTER: [number, number];
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const PLAY_VIDEO_TIMEOUT: 6000 = 6000;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const PROCESSING_HEIGHT: 432 = 432;
3
+ ```
@@ -0,0 +1,3 @@
1
+ ```ts
2
+ const PROCESSING_WIDTH: 768 = 768;
3
+ ```
@@ -0,0 +1,22 @@
1
+ ```ts
2
+ const PROCESS_STATUS: object;
3
+ ```
4
+
5
+ Process status
6
+
7
+ ## Type Declaration
8
+
9
+ | Name | Type |
10
+ | ------ | ------ |
11
+ | <a id="closed"></a> `Closed` | `"closed"` |
12
+ | <a id="closing"></a> `Closing` | `"closing"` |
13
+ | <a id="destroyed"></a> `Destroyed` | `"destroyed"` |
14
+ | <a id="destroying"></a> `Destroying` | `"destroying"` |
15
+ | <a id="error"></a> `Error` | `"Error"` |
16
+ | <a id="idle"></a> `Idle` | `"idle"` |
17
+ | <a id="new"></a> `New` | `"new"` |
18
+ | <a id="opened"></a> `Opened` | `"opened"` |
19
+ | <a id="opening"></a> `Opening` | `"opening"` |
20
+ | <a id="processing"></a> `Processing` | `"processing"` |
21
+ | <a id="updated"></a> `Updated` | `"updated"` |
22
+ | <a id="updating"></a> `Updating` | `"updating"` |
@@ -0,0 +1,14 @@
1
+ ```ts
2
+ const RENDERING_EVENTS: object;
3
+ ```
4
+
5
+ ## Type Declaration
6
+
7
+ | Name | Type | Description |
8
+ | ------ | ------ | ------ |
9
+ | <a id="contextcreationerror"></a> `ContextCreationError` | `"ContextCreationError"` | Triggered when failed to create a context |
10
+ | <a id="contextlost"></a> `ContextLost` | `"ContextLost"` | Triggered when context is lost |
11
+ | <a id="contextrestored"></a> `ContextRestored` | `"ContextRestored"` | Triggered when context is restored |
12
+ | <a id="error"></a> `Error` | `"Error"` | Triggered when there is unknown error |
13
+ | <a id="processorrestarted"></a> `ProcessorRestarted` | `"ProcessorRestarted"` | Triggered when the processor is restarted |
14
+ | <a id="samplingerror"></a> `SamplingError` | `"SamplingError"` | Triggered when sampling error occurs |
@@ -0,0 +1,10 @@
1
+ ```ts
2
+ const RENDER_BACKEND: object;
3
+ ```
4
+
5
+ ## Type Declaration
6
+
7
+ | Name | Type |
8
+ | ------ | ------ |
9
+ | <a id="webgl"></a> `WebGL` | `"webgl"` |
10
+ | <a id="webgpu"></a> `WebGPU` | `"webgpu"` |
@@ -0,0 +1,11 @@
1
+ ```ts
2
+ const RENDER_EFFECT: object;
3
+ ```
4
+
5
+ ## Type Declaration
6
+
7
+ | Name | Type |
8
+ | ------ | ------ |
9
+ | <a id="none"></a> `None` | `"none"` |
10
+ | <a id="blur"></a> `Blur` | `"blur"` |
11
+ | <a id="overlay"></a> `Overlay` | `"overlay"` |