@pexip/media-processor 16.7.1 → 17.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 (69) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -7
  3. package/dist/main/audio.d.ts +123 -0
  4. package/dist/main/audio.js +653 -0
  5. package/dist/main/benchUtils.d.ts +12 -0
  6. package/dist/main/benchUtils.js +34 -0
  7. package/dist/main/generator.d.ts +4 -0
  8. package/dist/main/generator.js +4 -0
  9. package/dist/main/index.d.ts +17 -0
  10. package/dist/main/index.js +17 -0
  11. package/dist/main/math.d.ts +41 -0
  12. package/dist/main/math.js +57 -0
  13. package/dist/main/path.d.ts +102 -0
  14. package/dist/main/path.js +103 -0
  15. package/dist/main/process.d.ts +239 -0
  16. package/dist/main/process.js +364 -0
  17. package/dist/main/processor.d.ts +5 -0
  18. package/dist/main/processor.js +4 -0
  19. package/dist/main/transformer.d.ts +1 -0
  20. package/dist/main/transformer.js +4 -0
  21. package/dist/main/tsconfig.tsbuildinfo +1 -0
  22. package/dist/main/typeGuards.d.ts +5 -0
  23. package/dist/main/typeGuards.js +24 -0
  24. package/dist/main/types.d.ts +342 -0
  25. package/dist/main/types.js +1 -0
  26. package/dist/main/utils.d.ts +173 -0
  27. package/dist/main/utils.js +364 -0
  28. package/dist/main/video/canvasRenderUtils.d.ts +22 -0
  29. package/dist/main/video/canvasRenderUtils.js +198 -0
  30. package/dist/main/video/canvasTransform.d.ts +8 -0
  31. package/dist/main/video/canvasTransform.js +173 -0
  32. package/dist/main/video/constants.d.ts +10 -0
  33. package/dist/main/video/constants.js +12 -0
  34. package/dist/main/video/index.d.ts +9 -0
  35. package/dist/main/video/index.js +9 -0
  36. package/dist/main/video/load.d.ts +17 -0
  37. package/dist/main/video/load.js +47 -0
  38. package/dist/main/video/segmenters/index.d.ts +1 -0
  39. package/dist/main/video/segmenters/index.js +1 -0
  40. package/dist/main/video/segmenters/mediapipe.d.ts +13 -0
  41. package/dist/main/video/segmenters/mediapipe.js +85 -0
  42. package/dist/main/video/transformer.d.ts +10 -0
  43. package/dist/main/video/transformer.js +56 -0
  44. package/dist/main/video/typeGuards.d.ts +2 -0
  45. package/dist/main/video/typeGuards.js +13 -0
  46. package/dist/main/video/types.d.ts +98 -0
  47. package/dist/main/video/types.js +20 -0
  48. package/dist/main/video/utils.d.ts +102 -0
  49. package/dist/main/video/utils.js +476 -0
  50. package/dist/main/video/video.d.ts +19 -0
  51. package/dist/main/video/video.js +48 -0
  52. package/dist/main/video/videoStreamTrackProcessor.d.ts +14 -0
  53. package/dist/main/video/videoStreamTrackProcessor.js +82 -0
  54. package/dist/main/visual.d.ts +80 -0
  55. package/dist/main/visual.js +135 -0
  56. package/dist/main/workletNodes.d.ts +2 -0
  57. package/dist/main/workletNodes.js +3 -0
  58. package/dist/workers/index.d.ts +0 -0
  59. package/dist/workers/index.js +1 -0
  60. package/dist/workers/tsconfig.tsbuildinfo +1 -0
  61. package/dist/worklets/denoise.worklet.d.ts +1 -0
  62. package/dist/worklets/denoise.worklet.js +1 -2
  63. package/dist/worklets/tsconfig.tsbuildinfo +1 -0
  64. package/dist/worklets/types.d.ts +52 -0
  65. package/dist/worklets/types.js +0 -0
  66. package/package.json +10 -8
  67. package/dist/index.d.ts +0 -1129
  68. package/dist/index.mjs +0 -2441
  69. package/dist/worklets/denoise.worklet.js.map +0 -7
@@ -0,0 +1,82 @@
1
+ import { createMediaStreamTrackProcessor } from '../processor';
2
+ import { createMediaStreamTrackGenerator } from '../generator';
3
+ import { createStreamTransformer } from '../transformer';
4
+ import { stopStreamTracks } from '../utils';
5
+ import { adaptInputFrameTransformer, nullTransformController, } from './transformer';
6
+ import { toVideoElement, playVideo, createFrameCallbackRequest, createCanvas, getImageSize, getCanvasRenderingContext2D, } from './utils';
7
+ import { AbortReason, PROCESSING_WIDTH, PROCESSING_HEIGHT, FRAME_RATE, } from './constants';
8
+ export const createVideoTrackProcessor = () => (track, transformers, { signal } = {}) => {
9
+ if (!transformers.length) {
10
+ return Promise.resolve(track);
11
+ }
12
+ const processor = createMediaStreamTrackProcessor({ track });
13
+ const trackGenerator = createMediaStreamTrackGenerator({ kind: 'video' });
14
+ let readable = processor.readable;
15
+ transformers.forEach(transformer => {
16
+ readable = readable.pipeThrough(createStreamTransformer(adaptInputFrameTransformer(transformer)), { signal });
17
+ });
18
+ // Promise returned from `ReadableStream['pipeTo']` is only resolved
19
+ // when the streaming is finished
20
+ readable
21
+ .pipeTo(trackGenerator.writable, {
22
+ signal,
23
+ })
24
+ .catch(error => {
25
+ // Ignore abort error
26
+ if (signal &&
27
+ !(signal.aborted &&
28
+ (signal.reason === AbortReason.Close ||
29
+ // AbortSignal['reason'] is only supported from Chromium v98 or Firefox v97
30
+ !('reason' in AbortSignal.prototype)))) {
31
+ throw error;
32
+ }
33
+ });
34
+ return Promise.resolve(trackGenerator);
35
+ };
36
+ export const createVideoTrackProcessorWithFallback = ({ width = PROCESSING_WIDTH, height = PROCESSING_HEIGHT, frameRate = FRAME_RATE, } = {}) => async (track, transformers, { signal } = {}) => {
37
+ const [transformer] = transformers;
38
+ if (!transformer?.transform) {
39
+ return track;
40
+ }
41
+ if (transformers.length > 1) {
42
+ throw new Error('Multi-transformer is NOT supported');
43
+ }
44
+ const outputCanvas = createCanvas(width, height);
45
+ const ctx = getCanvasRenderingContext2D(outputCanvas, { alpha: false });
46
+ const render = (input) => {
47
+ if (!transformer.transform) {
48
+ throw new Error('Transform is undefined');
49
+ }
50
+ return transformer.transform(input, nullTransformController({
51
+ enqueue: frame => {
52
+ if (!frame) {
53
+ return;
54
+ }
55
+ const frameSize = getImageSize(frame);
56
+ if (frameSize.height !== outputCanvas.height) {
57
+ outputCanvas.height = frameSize.height;
58
+ outputCanvas.width = frameSize.width;
59
+ }
60
+ ctx.drawImage(frame, 0, 0, frameSize.width, frameSize.height);
61
+ },
62
+ terminate: () => {
63
+ stop();
64
+ },
65
+ }));
66
+ };
67
+ const runner = createFrameCallbackRequest(render, frameRate);
68
+ const videoElement = toVideoElement(new MediaStream([track]), width, height);
69
+ await playVideo(videoElement);
70
+ await runner.start(videoElement);
71
+ const stream = outputCanvas.captureStream(frameRate);
72
+ const [trackGenerated] = stream.getVideoTracks();
73
+ if (!trackGenerated) {
74
+ throw new Error('Canvas captureStream returns no video track');
75
+ }
76
+ const stop = () => {
77
+ stopStreamTracks(stream);
78
+ runner.stop();
79
+ };
80
+ signal?.addEventListener('abort', stop);
81
+ return trackGenerated;
82
+ };
@@ -0,0 +1,80 @@
1
+ import type { Point } from './types';
2
+ /**
3
+ * Calculate the distance between two Points
4
+ *
5
+ * @param p1 - Point 1
6
+ * @param p2 - Point 2
7
+ *
8
+ * @internal
9
+ */
10
+ export declare function calculateDistance(p1: Point, p2: Point): number;
11
+ /**
12
+ * Spline Interpolation for Bezier Curve
13
+ *
14
+ * @param p1 - Starting point
15
+ * @param p2 - Point between p1 and p3
16
+ * @param p3 - Ending point
17
+ * @param t - tension constant
18
+ *
19
+ * @remarks
20
+ * Ref. http://scaledinnovation.com/analytics/splines/aboutSplines.html
21
+ * Alt. https://www.particleincell.com/2012/bezier-splines/
22
+ *
23
+ * @internal
24
+ */
25
+ export declare function getBezierCurveControlPoints({ p1, p2, p3, t, }: {
26
+ p1: Point;
27
+ p2: Point;
28
+ p3: Point;
29
+ t: number;
30
+ }): [Point, Point];
31
+ /**
32
+ * Create a straight line path command
33
+ *
34
+ * @param data - An array of Points
35
+ *
36
+ * @example
37
+ *
38
+ * ```typescript
39
+ * line([{x:0, y:0}, {x:2, y:2}]);
40
+ * // Output:
41
+ * // M 0,0 L 2,2
42
+ * ```
43
+ *
44
+ * @alpha
45
+ */
46
+ export declare const line: (data: Point[]) => string;
47
+ /**
48
+ * Create a cubic Bezier curve path command
49
+ *
50
+ * @param data - An array of Points
51
+ *
52
+ * @example
53
+ *
54
+ * ```typescript
55
+ * curve([{x:0, y:0}, {x:3, y:4}, {x:9, y:16}]);
56
+ * // Output:
57
+ * // M 0,0 C 0,0 1.778263374435667,1.8280237767745193 3,4 C 6.278263374435667,9.828023776774518 9,16 9,16
58
+ * ```
59
+ *
60
+ * @alpha
61
+ */
62
+ export declare const curve: (data: Point[]) => string;
63
+ /**
64
+ * Create a cubic Bezier curve path then turning back to the starting point with
65
+ * provided point of reference
66
+ *
67
+ * @param reference - reference coordinates, straight to y then x then the starting point
68
+ * @param data - An array of Points
69
+ *
70
+ * @example
71
+ *
72
+ * ```typescript
73
+ * closedCurve({x:0, y:20})([{x:0, y:0}, {x:3, y:4}, {x:9, y:16}]);
74
+ * // Output:
75
+ * // M 0,0 C 0,0 1.778263374435667,1.8280237767745193 3,4 C 6.278263374435667,9.828023776774518 9,16 9,16 V 20 H 0 Z
76
+ * ```
77
+ *
78
+ * @alpha
79
+ */
80
+ export declare const closedCurve: ({ x, y }: Point) => (data: Point[]) => string;
@@ -0,0 +1,135 @@
1
+ import { lineTo, moveTo, cubicCurveTo, verticalLineTo, horizontalLineTo, closePath, } from './path';
2
+ const toPoint = (t) => (t ? t : { x: 0, y: 0 });
3
+ /**
4
+ * Calculate the distance between two Points
5
+ *
6
+ * @param p1 - Point 1
7
+ * @param p2 - Point 2
8
+ *
9
+ * @internal
10
+ */
11
+ export function calculateDistance(p1, p2) {
12
+ return Math.sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2);
13
+ }
14
+ /**
15
+ * Spline Interpolation for Bezier Curve
16
+ *
17
+ * @param p1 - Starting point
18
+ * @param p2 - Point between p1 and p3
19
+ * @param p3 - Ending point
20
+ * @param t - tension constant
21
+ *
22
+ * @remarks
23
+ * Ref. http://scaledinnovation.com/analytics/splines/aboutSplines.html
24
+ * Alt. https://www.particleincell.com/2012/bezier-splines/
25
+ *
26
+ * @internal
27
+ */
28
+ export function getBezierCurveControlPoints({ p1, p2, p3, t, }) {
29
+ const d12 = calculateDistance(p1, p2);
30
+ const d23 = calculateDistance(p2, p3);
31
+ const widthOfT = p3.x - p1.x;
32
+ const heightOfT = p3.y - p1.y;
33
+ const scaleA = (t * d12) / (d12 + d23);
34
+ const scaleB = t - scaleA;
35
+ const cp12 = {
36
+ x: p2.x - scaleA * widthOfT,
37
+ y: p2.y - scaleA * heightOfT,
38
+ };
39
+ const cp23 = {
40
+ x: p2.x + scaleB * widthOfT,
41
+ y: p2.y + scaleB * heightOfT,
42
+ };
43
+ return [cp12, cp23];
44
+ }
45
+ /**
46
+ * Create a straight line path command
47
+ *
48
+ * @param data - An array of Points
49
+ *
50
+ * @example
51
+ *
52
+ * ```typescript
53
+ * line([{x:0, y:0}, {x:2, y:2}]);
54
+ * // Output:
55
+ * // M 0,0 L 2,2
56
+ * ```
57
+ *
58
+ * @alpha
59
+ */
60
+ export const line = (data) => {
61
+ if (data.length < 2) {
62
+ return '';
63
+ }
64
+ const [start, ...rest] = data;
65
+ return [moveTo(start), ...rest.map(lineTo)].join(' ');
66
+ };
67
+ /**
68
+ * Create a cubic Bezier curve path command
69
+ *
70
+ * @param data - An array of Points
71
+ *
72
+ * @example
73
+ *
74
+ * ```typescript
75
+ * curve([{x:0, y:0}, {x:3, y:4}, {x:9, y:16}]);
76
+ * // Output:
77
+ * // M 0,0 C 0,0 1.778263374435667,1.8280237767745193 3,4 C 6.278263374435667,9.828023776774518 9,16 9,16
78
+ * ```
79
+ *
80
+ * @alpha
81
+ */
82
+ export const curve = (data) => {
83
+ if (data.length <= 2) {
84
+ return line(data);
85
+ }
86
+ const [start, ...rest] = data;
87
+ const knots = rest.slice(0, -1);
88
+ const [end] = rest.slice(-1);
89
+ const tension = 1 / 2;
90
+ const cps = knots.map((current, idx, pts) => {
91
+ const prev = pts[idx - 1] || start;
92
+ const nxt = pts[idx + 1] || end;
93
+ return getBezierCurveControlPoints({
94
+ p1: toPoint(prev),
95
+ p2: current,
96
+ p3: toPoint(nxt),
97
+ t: tension,
98
+ });
99
+ });
100
+ const curveTo = (ep, idx) => {
101
+ const [scp] = cps[idx - 1]?.slice(-1) || [start];
102
+ const [ecp] = cps[idx] || [end];
103
+ return cubicCurveTo({
104
+ scp: toPoint(scp),
105
+ ecp: toPoint(ecp),
106
+ ep,
107
+ });
108
+ };
109
+ return [moveTo(start), ...rest.map(curveTo)].join(' ');
110
+ };
111
+ /**
112
+ * Create a cubic Bezier curve path then turning back to the starting point with
113
+ * provided point of reference
114
+ *
115
+ * @param reference - reference coordinates, straight to y then x then the starting point
116
+ * @param data - An array of Points
117
+ *
118
+ * @example
119
+ *
120
+ * ```typescript
121
+ * closedCurve({x:0, y:20})([{x:0, y:0}, {x:3, y:4}, {x:9, y:16}]);
122
+ * // Output:
123
+ * // M 0,0 C 0,0 1.778263374435667,1.8280237767745193 3,4 C 6.278263374435667,9.828023776774518 9,16 9,16 V 20 H 0 Z
124
+ * ```
125
+ *
126
+ * @alpha
127
+ */
128
+ export const closedCurve = ({ x, y }) => (data) => {
129
+ return [
130
+ curve(data),
131
+ verticalLineTo(y),
132
+ horizontalLineTo(x),
133
+ closePath(),
134
+ ].join(' ');
135
+ };
@@ -0,0 +1,2 @@
1
+ import type { WasmWorkletNodeOptions } from '../worklets/types';
2
+ export declare const createDenoiseWorkletNode: (context: BaseAudioContext, options: WasmWorkletNodeOptions) => AudioWorkletNode;
@@ -0,0 +1,3 @@
1
+ export const createDenoiseWorkletNode = (context, options) => {
2
+ return new AudioWorkletNode(context, 'denoise-processor', options);
3
+ };
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es5.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2016.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2023.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.esnext.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.webworker.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.decorators.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/workers/index.ts","../../../../.yarn/cache/@types-audioworklet-npm-0.0.41-ec4bc90857-44eca22f47.zip/node_modules/@types/audioworklet/iterable.d.ts","../../../../.yarn/cache/@types-audioworklet-npm-0.0.41-ec4bc90857-44eca22f47.zip/node_modules/@types/audioworklet/index.d.ts","../../../../.yarn/cache/@types-dom-webcodecs-npm-0.1.6-99f0388946-1643c98cd7.zip/node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts","../../../../.yarn/cache/@types-dom-webcodecs-npm-0.1.6-99f0388946-1643c98cd7.zip/node_modules/@types/dom-webcodecs/index.d.ts","../../../../.yarn/cache/@types-offscreencanvas-npm-2019.7.0-c691495e16-018cfcd19e.zip/node_modules/@types/offscreencanvas/index.d.ts","../../../../.yarn/cache/@types-trusted-types-npm-2.0.3-225cf76fb4-4794804bc4.zip/node_modules/@types/trusted-types/lib/index.d.ts","../../../../.yarn/cache/@types-trusted-types-npm-2.0.3-225cf76fb4-4794804bc4.zip/node_modules/@types/trusted-types/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"62e1c7a72e1b022223e86a5e7bbabbd2931ab5ec141c940e45db8facfb0d9f0f","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"95f22ce5f9dbcfc757ff850e7326a1ba1bc69806f1e70f48caefa824819d6f4f","affectsGlobalScope":true},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",{"version":"b38d0bfd2d1c1536d40fc5941fab5c5dd2749fb874fb57c451211ab806a3be8a","affectsGlobalScope":true},{"version":"8c63699627e2dd957f31dddfaf644a96ccf92eec6e9277a430421ae2d7e98b00","affectsGlobalScope":true},{"version":"d3c76be3a6bc6fdb449d8f6e60e70f1beaafda51e438bc9d710142dcc78639cf","affectsGlobalScope":true},{"version":"4851e85afe66f48f4086aed909ecb812fab71194a979aed80734d5e39cfc6634","affectsGlobalScope":true},{"version":"86cc8969b76067ccf25e02c62b7df6ccdb419481fbce594b5ae9da21e9015e39","affectsGlobalScope":true},"2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"3c150a2e1758724811db3bdc5c773421819343b1627714e09f29b1f40a5dfb26","affectsGlobalScope":true}],"root":[61],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"jsx":2,"module":99,"noImplicitAny":true,"noUncheckedIndexedAccess":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true,"sourceMap":false,"strict":true,"target":7},"fileIdsList":[[62],[64],[67]],"referencedMap":[[63,1],[65,2],[68,3]],"exportedModulesMap":[[63,1],[65,2],[68,3]],"semanticDiagnosticsPerFile":[63,62,65,64,66,68,67,59,60,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,12,61],"latestChangedDtsFile":"./index.d.ts"},"version":"5.0.2"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";(()=>{var G=!0,g=String.fromCharCode,M={}.toString,H=M(),x=Uint8Array,A=x||Array,E=x?ArrayBuffer:A,q=E.isView||function(e){return e&&"length"in e},z=M.call(E.prototype);var N=T.prototype;var Z=/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,c=new(x?Uint16Array:A)(32);function D(){}D.prototype.decode=function(e){var t=e,s;if(!q(t)){if(s=M.call(t),s!==z&&s!==H)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");t=x?new A(t):t||[]}for(var o="",n="",a=0,r=t.length|0,i=r-32|0,d=0,w=0,f=0,u=0,l=0,m=0,p=0,b=-1;a<r;){for(d=a<=i?32:r-a|0;p<d;a=a+1|0,p=p+1|0){switch(f=t[a]&255,f>>4){case 15:if(m=t[a=a+1|0]&255,m>>6!==2||247<f){a=a-1|0;break}u=(f&7)<<6|m&63,l=5,f=256;case 14:m=t[a=a+1|0]&255,u<<=6,u|=(f&15)<<6|m&63,l=m>>6===2?l+4|0:24,f=f+256&768;case 13:case 12:m=t[a=a+1|0]&255,u<<=6,u|=(f&31)<<6|m&63,l=l+7|0,a<r&&m>>6===2&&u>>l&&u<1114112?(f=u,u=u-65536|0,0<=u?(b=(u>>10)+55296|0,f=(u&1023)+56320|0,p<31?(c[p]=b,p=p+1|0,b=-1):(m=b,b=f,f=m)):d=d+1|0):(f>>=8,a=a-f-1|0,f=65533),l=0,u=0,d=a<=i?32:r-a|0;default:c[p]=f;continue;case 11:case 10:case 9:case 8:}c[p]=65533}if(n+=g(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15],c[16],c[17],c[18],c[19],c[20],c[21],c[22],c[23],c[24],c[25],c[26],c[27],c[28],c[29],c[30],c[31]),p<32&&(n=n.slice(0,p-32|0)),a<r){if(c[0]=b,p=~b>>>31,b=-1,n.length<o.length)continue}else b!==-1&&(n+=g(b));o+=n,n=""}return o};function J(e){var t=e.charCodeAt(0)|0;if(55296<=t)if(t<=56319){var s=e.charCodeAt(1)|0;if(56320<=s&&s<=57343){if(t=(t<<10)+s-56613888|0,t>65535)return g(30<<3|t>>18,2<<6|t>>12&63,2<<6|t>>6&63,2<<6|t&63)}else t=65533}else t<=57343&&(t=65533);return t<=2047?g(6<<5|t>>6,2<<6|t&63):g(14<<4|t>>12,2<<6|t>>6&63,2<<6|t&63)}function T(){}N.encode=function(e){var t=e===void 0?"":""+e,s=t.length|0,o=new A((s<<1)+8|0),n,a=0,r=0,i=0,d=0,w=!x;for(a=0;a<s;a=a+1|0,r=r+1|0)if(i=t.charCodeAt(a)|0,i<=127)o[r]=i;else if(i<=2047)o[r]=6<<5|i>>6,o[r=r+1|0]=2<<6|i&63;else{e:{if(55296<=i)if(i<=56319){if(d=t.charCodeAt(a=a+1|0)|0,56320<=d&&d<=57343){if(i=(i<<10)+d-56613888|0,i>65535){o[r]=30<<3|i>>18,o[r=r+1|0]=2<<6|i>>12&63,o[r=r+1|0]=2<<6|i>>6&63,o[r=r+1|0]=2<<6|i&63;continue}break e}i=65533}else i<=57343&&(i=65533);!w&&a<<1<r&&a<<1<(r-7|0)&&(w=!0,n=new A(s*3),n.set(o),o=n)}o[r]=14<<4|i>>12,o[r=r+1|0]=2<<6|i>>6&63,o[r=r+1|0]=2<<6|i&63}return x?o.subarray(0,r):o.slice(0,r)};function K(e,t){var s=e===void 0?"":(""+e).replace(Z,J),o=s.length|0,n=0,a=0,r=0,i=t.length|0,d=e.length|0;i<o&&(o=i);e:for(;n<o;n=n+1|0){switch(a=s.charCodeAt(n)|0,a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r=r+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((n+1|0)<i){r=r+1|0;break}case 14:if((n+2|0)<i){r=r+1|0;break}case 15:if((n+3|0)<i){r=r+1|0;break}default:break e}t[n]=a}return{written:n,read:d<r?d:r}}G&&(N.encodeInto=K);var re={},y,h=new Array(32).fill(void 0);h.push(void 0,null,!0,!1);function F(e){return h[e]}var _=h.length;function Q(e){e<36||(h[e]=_,_=e)}function X(e){let t=F(e);return Q(e),t}var W=new D("utf-8",{ignoreBOM:!0,fatal:!0});W.decode();var v=null;function S(){return(v===null||v.buffer!==y.memory.buffer)&&(v=new Uint8Array(y.memory.buffer)),v}function I(e,t){return W.decode(S().subarray(e,e+t))}function Y(e){_===h.length&&h.push(h.length+1);let t=_;return _=h[t],h[t]=e,t}var O=0,k=new T("utf-8"),$=typeof k.encodeInto=="function"?function(e,t){return k.encodeInto(e,t)}:function(e,t){let s=k.encode(e);return t.set(s),{read:e.length,written:s.length}};function ee(e,t,s){if(s===void 0){let i=k.encode(e),d=t(i.length);return S().subarray(d,d+i.length).set(i),O=i.length,d}let o=e.length,n=t(o),a=S(),r=0;for(;r<o;r++){let i=e.charCodeAt(r);if(i>127)break;a[n+r]=i}if(r!==o){r!==0&&(e=e.slice(r)),n=s(n,o,o=r+e.length*3);let i=S().subarray(n+r,n+o),d=$(e,i);r+=d.written}return O=r,n}var C=null;function R(){return(C===null||C.buffer!==y.memory.buffer)&&(C=new Int32Array(y.memory.buffer)),C}async function te(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(o){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o);else throw o}let s=await e.arrayBuffer();return await WebAssembly.instantiate(s,t)}else{let s=await WebAssembly.instantiate(e,t);return s instanceof WebAssembly.Instance?{instance:s,module:e}:s}}async function B(e){typeof e>"u"&&(e=new URL("denoise_bg.wasm",re.url));let t={};t.wbg={},t.wbg.__wbg_new_693216e109162396=function(){var n=new Error;return Y(n)},t.wbg.__wbg_stack_0ddaca5d1abfb52f=function(n,a){var r=F(a).stack,i=ee(r,y.__wbindgen_malloc,y.__wbindgen_realloc),d=O;R()[n/4+1]=d,R()[n/4+0]=i},t.wbg.__wbg_error_09919627ac0992f5=function(n,a){try{console.error(I(n,a))}finally{y.__wbindgen_free(n,a)}},t.wbg.__wbindgen_object_drop_ref=function(n){X(n)},t.wbg.__wbindgen_throw=function(n,a){throw new Error(I(n,a))},(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:s,module:o}=await te(await e,t);return y=s.exports,B.__wbindgen_wasm_module=o,y}var L=B;var U=()=>typeof AudioWorkletProcessor<"u"&&typeof registerProcessor=="function";var P=(e,t)=>{e.forEach((s,o)=>s.forEach((n,a)=>{t(n,a,o)}))},V=(e,t)=>{P(t,(s,o,n)=>{let a=e[n]?.[o];a&&s.set(a)})},j=(e,t,s)=>{let o=e.denoise_new(s,t),n=!1,a=()=>new Float32Array(e.memory.buffer,e.denoise_input(o),s*t),r=()=>new Float32Array(e.memory.buffer,e.denoise_output(o),s*t);return{vad:i=>e.denoise_vad(o,i),free:()=>{let i=o;o=0,e.__wbg_denoise_free(i),n=!0},pipe:(i,d)=>{if(n)return;let w=a();P(i,(u,l)=>{w.set(u,l*u.length)}),e.denoise_process_frames(o);let f=r();P(d,(u,l)=>{u.set(f.slice(l*u.length,(l+1)*u.length))})}}};var ne=128;if(U()){class e extends AudioWorkletProcessor{constructor(o){super(o);this.processing=!0;this.shouldSendVAD=!1;this.enabled=!0;let n=o?.processorOptions;if(!n?.data)throw new Error("No WebAssembly data provided!");if(!n?.sampleRate)throw new Error("No Sample Rate provided!");this.shouldSendVAD=!!n?.shouldSendVAD;let a=o?.outputChannelCount?.[0]??1;L(n.data).then(r=>{this.denoise=j(r,a,ne)}),this.port.onmessage=r=>{switch(r.data.type){case"release":{this.denoise?.free(),this.processing=!1;break}case"enable":{this.enabled=r.data.value;break}default:break}}}process(o,n,a){return!this.denoise||!this.enabled||!this.processing?(V(o,n),this.processing):(this.denoise.pipe(o,n),this.shouldSendVAD&&this.port.postMessage(Array.from({length:o[0]?.length??2}).map((r,i)=>this.denoise?.vad(i))),this.processing)}}registerProcessor("denoise-processor",e)}})();
2
- //# sourceMappingURL=denoise.worklet.js.map
1
+ var N=!0,w=String.fromCharCode,W={}.toString,V=W(),_=Uint8Array,m=_||Array,B=_?ArrayBuffer:m,L=B.isView||function(e){return e&&"length"in e},q=W.call(B.prototype);var R=D.prototype;var H=/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,f=new(_?Uint16Array:m)(32);function E(){}E.prototype.decode=function(e){var t=e,a;if(!L(t)){if(a=W.call(t),a!==q&&a!==V)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");t=_?new m(t):t||[]}for(var o="",n="",s=0,r=t.length|0,i=r-32|0,c=0,g=0,u=0,d=0,l=0,b=0,p=0,h=-1;s<r;){for(c=s<=i?32:r-s|0;p<c;s=s+1|0,p=p+1|0){switch(u=t[s]&255,u>>4){case 15:if(b=t[s=s+1|0]&255,b>>6!==2||247<u){s=s-1|0;break}d=(u&7)<<6|b&63,l=5,u=256;case 14:b=t[s=s+1|0]&255,d<<=6,d|=(u&15)<<6|b&63,l=b>>6===2?l+4|0:24,u=u+256&768;case 13:case 12:b=t[s=s+1|0]&255,d<<=6,d|=(u&31)<<6|b&63,l=l+7|0,s<r&&b>>6===2&&d>>l&&d<1114112?(u=d,d=d-65536|0,0<=d?(h=(d>>10)+55296|0,u=(d&1023)+56320|0,p<31?(f[p]=h,p=p+1|0,h=-1):(b=h,h=u,u=b)):c=c+1|0):(u>>=8,s=s-u-1|0,u=65533),l=0,d=0,c=s<=i?32:r-s|0;default:f[p]=u;continue;case 11:case 10:case 9:case 8:}f[p]=65533}if(n+=w(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15],f[16],f[17],f[18],f[19],f[20],f[21],f[22],f[23],f[24],f[25],f[26],f[27],f[28],f[29],f[30],f[31]),p<32&&(n=n.slice(0,p-32|0)),s<r){if(f[0]=h,p=~h>>>31,h=-1,n.length<o.length)continue}else h!==-1&&(n+=w(h));o+=n,n=""}return o};function Z(e){var t=e.charCodeAt(0)|0;if(55296<=t)if(t<=56319){var a=e.charCodeAt(1)|0;if(56320<=a&&a<=57343){if(t=(t<<10)+a-56613888|0,t>65535)return w(30<<3|t>>18,2<<6|t>>12&63,2<<6|t>>6&63,2<<6|t&63)}else t=65533}else t<=57343&&(t=65533);return t<=2047?w(6<<5|t>>6,2<<6|t&63):w(14<<4|t>>12,2<<6|t>>6&63,2<<6|t&63)}function D(){}R.encode=function(e){var t=e===void 0?"":""+e,a=t.length|0,o=new m((a<<1)+8|0),n,s=0,r=0,i=0,c=0,g=!_;for(s=0;s<a;s=s+1|0,r=r+1|0)if(i=t.charCodeAt(s)|0,i<=127)o[r]=i;else if(i<=2047)o[r]=6<<5|i>>6,o[r=r+1|0]=2<<6|i&63;else{e:{if(55296<=i)if(i<=56319){if(c=t.charCodeAt(s=s+1|0)|0,56320<=c&&c<=57343){if(i=(i<<10)+c-56613888|0,i>65535){o[r]=30<<3|i>>18,o[r=r+1|0]=2<<6|i>>12&63,o[r=r+1|0]=2<<6|i>>6&63,o[r=r+1|0]=2<<6|i&63;continue}break e}i=65533}else i<=57343&&(i=65533);!g&&s<<1<r&&s<<1<(r-7|0)&&(g=!0,n=new m(a*3),n.set(o),o=n)}o[r]=14<<4|i>>12,o[r=r+1|0]=2<<6|i>>6&63,o[r=r+1|0]=2<<6|i&63}return _?o.subarray(0,r):o.slice(0,r)};function G(e,t){var a=e===void 0?"":(""+e).replace(H,Z),o=a.length|0,n=0,s=0,r=0,i=t.length|0,c=e.length|0;i<o&&(o=i);e:for(;n<o;n=n+1|0){switch(s=a.charCodeAt(n)|0,s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r=r+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((n+1|0)<i){r=r+1|0;break}case 14:if((n+2|0)<i){r=r+1|0;break}case 15:if((n+3|0)<i){r=r+1|0;break}default:break e}t[n]=s}return{written:n,read:c<r?c:r}}N&&(R.encodeInto=G);var x,y=new Array(32).fill(void 0);y.push(void 0,null,!0,!1);function P(e){return y[e]}var v=y.length;function J(e){e<36||(y[e]=v,v=e)}function K(e){let t=P(e);return J(e),t}var T=new E("utf-8",{ignoreBOM:!0,fatal:!0});T.decode();var A=null;function k(){return(A===null||A.buffer!==x.memory.buffer)&&(A=new Uint8Array(x.memory.buffer)),A}function C(e,t){return T.decode(k().subarray(e,e+t))}function Q(e){v===y.length&&y.push(y.length+1);let t=v;return v=y[t],y[t]=e,t}var S=0,O=new D("utf-8"),X=typeof O.encodeInto=="function"?function(e,t){return O.encodeInto(e,t)}:function(e,t){let a=O.encode(e);return t.set(a),{read:e.length,written:a.length}};function Y(e,t,a){if(a===void 0){let i=O.encode(e),c=t(i.length);return k().subarray(c,c+i.length).set(i),S=i.length,c}let o=e.length,n=t(o),s=k(),r=0;for(;r<o;r++){let i=e.charCodeAt(r);if(i>127)break;s[n+r]=i}if(r!==o){r!==0&&(e=e.slice(r)),n=a(n,o,o=r+e.length*3);let i=k().subarray(n+r,n+o),c=X(e,i);r+=c.written}return S=r,n}var F=null;function M(){return(F===null||F.buffer!==x.memory.buffer)&&(F=new Int32Array(x.memory.buffer)),F}async function $(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(o){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o);else throw o}let a=await e.arrayBuffer();return await WebAssembly.instantiate(a,t)}else{let a=await WebAssembly.instantiate(e,t);return a instanceof WebAssembly.Instance?{instance:a,module:e}:a}}async function U(e){typeof e>"u"&&(e=new URL("denoise_bg.wasm",import.meta.url));let t={};t.wbg={},t.wbg.__wbg_new_693216e109162396=function(){var n=new Error;return Q(n)},t.wbg.__wbg_stack_0ddaca5d1abfb52f=function(n,s){var r=P(s).stack,i=Y(r,x.__wbindgen_malloc,x.__wbindgen_realloc),c=S;M()[n/4+1]=c,M()[n/4+0]=i},t.wbg.__wbg_error_09919627ac0992f5=function(n,s){try{console.error(C(n,s))}finally{x.__wbindgen_free(n,s)}},t.wbg.__wbindgen_object_drop_ref=function(n){K(n)},t.wbg.__wbindgen_throw=function(n,s){throw new Error(C(n,s))},(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:a,module:o}=await $(await e,t);return x=a.exports,U.__wbindgen_wasm_module=o,x}var j=U;var z=128,I=(e,t)=>{e.forEach((a,o)=>a.forEach((n,s)=>{t(n,s,o)}))},ee=(e,t)=>{I(t,(a,o,n)=>{let s=e[n]?.[o];s&&a.set(s)})},te=(e,t,a)=>{let o=e.denoise_new(a,t),n=!1,s=()=>new Float32Array(e.memory.buffer,e.denoise_input(o),a*t),r=()=>new Float32Array(e.memory.buffer,e.denoise_output(o),a*t);return{vad:i=>e.denoise_vad(o,i),free:()=>{let i=o;o=0,e.__wbg_denoise_free(i),n=!0},pipe:(i,c)=>{if(n)return;let g=s();I(i,(d,l)=>{g.set(d,l*d.length)}),e.denoise_process_frames(o);let u=r();I(c,(d,l)=>{d.set(u.slice(l*d.length,(l+1)*d.length))})}}},re=()=>typeof AudioWorkletProcessor<"u"&&typeof registerProcessor=="function";if(re()){class e extends AudioWorkletProcessor{constructor(o){super(o);this.processing=!0;this.shouldSendVAD=!1;this.enabled=!0;let n=o?.processorOptions;if(!n?.data)throw new Error("No WebAssembly data provided!");if(!n?.sampleRate)throw new Error("No Sample Rate provided!");this.shouldSendVAD=!!n?.shouldSendVAD;let s=o?.outputChannelCount?.[0]??1;j(n.data).then(r=>{this.denoise=te(r,s,z)}),this.port.onmessage=r=>{switch(r.data.type){case"release":{this.denoise?.free(),this.processing=!1;break}case"enable":{this.enabled=r.data.value;break}default:break}}}process(o,n,s){return!this.denoise||!this.enabled||!this.processing?(ee(o,n),this.processing):(this.denoise.pipe(o,n),this.shouldSendVAD&&this.port.postMessage(Array.from({length:o[0]?.length??2}).map((r,i)=>this.denoise?.vad(i))),this.processing)}}registerProcessor("denoise-processor",e)}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es5.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2016.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2023.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.esnext.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.decorators.d.ts","../../../../.yarn/cache/typescript-patch-98addd7229-0411be9e19.zip/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../denoise/denoise.d.ts","../../src/worklets/types.ts","../../src/worklets/denoise.worklet.ts","../../../../.yarn/cache/@types-audioworklet-npm-0.0.41-ec4bc90857-44eca22f47.zip/node_modules/@types/audioworklet/iterable.d.ts","../../../../.yarn/cache/@types-audioworklet-npm-0.0.41-ec4bc90857-44eca22f47.zip/node_modules/@types/audioworklet/index.d.ts","../../../../.yarn/cache/@types-dom-webcodecs-npm-0.1.6-99f0388946-1643c98cd7.zip/node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts","../../../../.yarn/cache/@types-dom-webcodecs-npm-0.1.6-99f0388946-1643c98cd7.zip/node_modules/@types/dom-webcodecs/index.d.ts","../../../../.yarn/cache/@types-offscreencanvas-npm-2019.7.0-c691495e16-018cfcd19e.zip/node_modules/@types/offscreencanvas/index.d.ts","../../../../.yarn/cache/@types-trusted-types-npm-2.0.3-225cf76fb4-4794804bc4.zip/node_modules/@types/trusted-types/lib/index.d.ts","../../../../.yarn/cache/@types-trusted-types-npm-2.0.3-225cf76fb4-4794804bc4.zip/node_modules/@types/trusted-types/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"95f22ce5f9dbcfc757ff850e7326a1ba1bc69806f1e70f48caefa824819d6f4f","affectsGlobalScope":true},"abe48ce0a341027bb51637157f0f95b66c993fe2488bf8a5ecc01e4af46c3321",{"version":"e4eefcb6855f59f55afa9d2b6ea978f2a298f6be45b2d5880784e70c4c571767","signature":"f81c1cbc25b7a15399134593d08aaca2517ee5b093db190255fe10335fc3ec57"},{"version":"352b0771721a371a553e1c8e9307bf4b5170964e0b2839949c602abd04a4f325","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"b38d0bfd2d1c1536d40fc5941fab5c5dd2749fb874fb57c451211ab806a3be8a","affectsGlobalScope":true},{"version":"8c63699627e2dd957f31dddfaf644a96ccf92eec6e9277a430421ae2d7e98b00","affectsGlobalScope":true},{"version":"d3c76be3a6bc6fdb449d8f6e60e70f1beaafda51e438bc9d710142dcc78639cf","affectsGlobalScope":true},{"version":"4851e85afe66f48f4086aed909ecb812fab71194a979aed80734d5e39cfc6634","affectsGlobalScope":true},{"version":"86cc8969b76067ccf25e02c62b7df6ccdb419481fbce594b5ae9da21e9015e39","affectsGlobalScope":true},"2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"3c150a2e1758724811db3bdc5c773421819343b1627714e09f29b1f40a5dfb26","affectsGlobalScope":true}],"root":[61,62],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"jsx":2,"module":99,"noImplicitAny":true,"noUncheckedIndexedAccess":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true,"sourceMap":false,"strict":true,"target":7},"fileIdsList":[[63],[65],[68],[60,61]],"referencedMap":[[64,1],[66,2],[69,3],[62,4]],"exportedModulesMap":[[64,1],[66,2],[69,3]],"semanticDiagnosticsPerFile":[64,63,66,65,67,69,68,58,59,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,55,53,54,56,10,1,11,57,60,62,61],"latestChangedDtsFile":"./denoise.worklet.d.ts"},"version":"5.0.2"}
@@ -0,0 +1,52 @@
1
+ /// <reference types="audioworklet" />
2
+ /// <reference types="audioworklet" />
3
+ /**
4
+ * Audio Processor Message to post to AudioWorkletProcessor
5
+ */
6
+ export type AudioProcessorRelease = {
7
+ type: 'release';
8
+ };
9
+ export type AudioProcessorEnable = {
10
+ type: 'enable';
11
+ value: boolean;
12
+ };
13
+ export type AudioProcessorMessageEvent = MessageEvent<AudioProcessorRelease | AudioProcessorEnable>;
14
+ type ChannelCountMode = 'clamped-max' | 'explicit' | 'max';
15
+ type ChannelInterpretation = 'discrete' | 'speakers';
16
+ interface AudioNodeOptions {
17
+ channelCount?: number;
18
+ channelCountMode?: ChannelCountMode;
19
+ channelInterpretation?: ChannelInterpretation;
20
+ }
21
+ export interface AudioWorkletNodeOptions extends AudioNodeOptions {
22
+ numberOfInputs?: number;
23
+ numberOfOutputs?: number;
24
+ outputChannelCount?: number[];
25
+ parameterData?: Record<string, number>;
26
+ processorOptions?: any;
27
+ }
28
+ /**
29
+ * Pass the wasm module from `AudioWorkletNode` to `AudioWorkletProcessor` via
30
+ * `AudioWorkletNodeOptions`
31
+ *
32
+ * - data: The wasm module data
33
+ * - sampleRate: The sample rate for the context
34
+ * - shouldSendVAD: Should post VADs to main
35
+ */
36
+ export interface WasmProcessorOptions {
37
+ data: BufferSource;
38
+ sampleRate: number;
39
+ shouldSendVAD?: boolean;
40
+ }
41
+ export interface WasmWorkletNodeOptions extends AudioWorkletNodeOptions {
42
+ processorOptions?: WasmProcessorOptions;
43
+ }
44
+ /**
45
+ * A wrapper for the Denoise wasm module
46
+ */
47
+ export interface Denoise {
48
+ vad(channel: number): number;
49
+ free(): void;
50
+ pipe(inputs: Float32Array[][], outputs: Float32Array[][]): void;
51
+ }
52
+ export {};
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pexip/media-processor",
3
- "version": "16.7.1",
3
+ "version": "17.0.0",
4
4
  "description": "Media processor for video and audio",
5
5
  "homepage": "https://gitlab.com/pexip/zoo",
6
6
  "bugs": "https://gitlab.com/pexip/zoo/issues",
@@ -10,8 +10,8 @@
10
10
  "directory": "src/aquila/packages/media-processor"
11
11
  },
12
12
  "license": "Apache-2.0",
13
- "module": "dist/index.mjs",
14
- "types": "dist/index.d.ts",
13
+ "module": "dist/main/index.js",
14
+ "types": "dist/main/index.d.ts",
15
15
  "directories": {
16
16
  "lib": "dist",
17
17
  "test": "__tests__"
@@ -20,11 +20,12 @@
20
20
  "dist"
21
21
  ],
22
22
  "scripts": {
23
- "build": "pexip-bundler build && yarn build:worklets",
23
+ "build": "yarn build:main && yarn build:worklets",
24
+ "build:main": "yarn pexip-bundler build --bundler=tsc -c ./src/main",
24
25
  "build:denoise": "cd denoise && wasm-pack build -t web && printf '%s\n%s\n' \"import {TextDecoder, TextEncoder} from './EncoderDecoder';\" \"$(cat ./pkg/denoise.js)\" >./pkg/denoise.js && prettier --write pkg && cp pkg/denoise* ../../denoise/",
25
26
  "build:worklets": "pexip-bundler build --bundler=esbuild -o dist/worklets -b src/worklets/*.ts",
26
27
  "clean": "rm -fr dist",
27
- "prepack": "yarn build",
28
+ "prepack": "yarn clean && yarn build:main --no-sourcemap && yarn build:worklets --no-sourcemap",
28
29
  "test": "pexip-bundler test",
29
30
  "tsc": "tsc --noEmit",
30
31
  "check-format": "prettier --ignore-path=../../.prettierignore --check .",
@@ -33,14 +34,15 @@
33
34
  "typecheck": "yarn tsc --noEmit -p ."
34
35
  },
35
36
  "dependencies": {
36
- "@pexip/bg-blur": "16.4.0",
37
+ "@mediapipe/selfie_segmentation": "^0.1.1675465747",
37
38
  "@pexip/denoise": "16.3.0",
38
39
  "@pexip/utils": "16.6.0",
39
40
  "@tensorflow/tfjs-backend-webgl": "^4.0.0",
40
41
  "@tensorflow/tfjs-core": "^4.0.0"
41
42
  },
42
43
  "devDependencies": {
43
- "@pexip/bundler": "16.3.0",
44
+ "@pexip/bundler": "16.4.0",
45
+ "@types/audioworklet": "^0.0.41",
44
46
  "@types/dom-webcodecs": "^0.1.4",
45
47
  "@types/offscreencanvas": "^2019.7.0",
46
48
  "@types/trusted-types": "^2.0.2",
@@ -48,6 +50,6 @@
48
50
  },
49
51
  "publishConfig": {
50
52
  "access": "public",
51
- "registry": "https://registry.npmjs.org"
53
+ "registry": "https://registry.npmjs.org/"
52
54
  }
53
55
  }