playout-audio-worklet 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/es2019/module.d.ts.map +1 -1
- package/build/es2019/module.js +5 -4
- package/build/es2019/module.js.map +1 -1
- package/build/es2019/types/native-playout-audio-worklet-node-options.d.ts +2 -2
- package/build/es2019/types/native-playout-audio-worklet-node-options.d.ts.map +1 -1
- package/build/es2019/types/playout-audio-worklet-node-options.d.ts +2 -2
- package/build/es2019/types/playout-audio-worklet-node-options.d.ts.map +1 -1
- package/build/es5/bundle.js +5 -4
- package/package.json +10 -10
- package/src/module.ts +6 -5
- package/src/types/native-playout-audio-worklet-node-options.ts +2 -2
- package/src/types/playout-audio-worklet-node-options.ts +2 -2
package/LICENSE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,4BAA4B,EAC5B,QAAQ,EAER,kCAAkC,EAClC,cAAc,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAA+B,kCAAkC,EAAiB,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAOzI,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAI9B,eAAO,MAAM,4BAA4B,GAAU,uBAAuB,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,kBAQvG,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,QAAQ,GAAG,cAAc,EAC7E,2BAA2B,EAAE,CAAC,SAAS,QAAQ,GAAG,4BAA4B,GAAG,kCAAkC,EACnH,OAAO,EAAE,CAAC,EACV,EACI,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,GAAG,OAAO,EACb,EAAE,kCAAkC,CAAC,CAAC,CAAC,GACzC,CAAC,SAAS,QAAQ,GAAG,wBAAwB,CAAC,CAAC,CAAC,GAAG,8BAA8B,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,4BAA4B,EAC5B,QAAQ,EAER,kCAAkC,EAClC,cAAc,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAA+B,kCAAkC,EAAiB,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAOzI,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAI9B,eAAO,MAAM,4BAA4B,GAAU,uBAAuB,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,kBAQvG,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,QAAQ,GAAG,cAAc,EAC7E,2BAA2B,EAAE,CAAC,SAAS,QAAQ,GAAG,4BAA4B,GAAG,kCAAkC,EACnH,OAAO,EAAE,CAAC,EACV,EACI,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,GAAG,OAAO,EACb,EAAE,kCAAkC,CAAC,CAAC,CAAC,GACzC,CAAC,SAAS,QAAQ,GAAG,wBAAwB,CAAC,CAAC,CAAC,GAAG,8BAA8B,CAuCnF"}
|
package/build/es2019/module.js
CHANGED
|
@@ -32,13 +32,14 @@ export function createPlayoutAudioWorkletNode(audioWorkletNodeConstructor, conte
|
|
|
32
32
|
...options,
|
|
33
33
|
...fixedOptions
|
|
34
34
|
});
|
|
35
|
+
const { port } = audioWorkletNode;
|
|
35
36
|
const listener = () => {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
port.removeEventListener('message', listener);
|
|
38
|
+
port.close();
|
|
38
39
|
audioWorkletNode.dispatchEvent(new Event('ended'));
|
|
39
40
|
};
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
port.addEventListener('message', listener);
|
|
42
|
+
port.start();
|
|
42
43
|
Object.defineProperties(audioWorkletNode, {
|
|
43
44
|
port: {
|
|
44
45
|
get() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;;GAGG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAE9B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,uCAAuC,EAAE,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAAE,qBAAqD,EAAE,EAAE;IACxG,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtC,IAAI,CAAC;QACD,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;YAAS,CAAC;QACP,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,UAAU,6BAA6B,CACzC,2BAAmH,EACnH,OAAU,EACV,EACI,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,GAAG,OAAO,EAC0B;IAKxC,MAAM,YAAY,GAAkE;QAChF,cAAc,EAAE,CAAC;QACjB,eAAe,EAAE,CAAC;QAClB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;;GAGG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAE9B,MAAM,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CAAC;IAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;IAEb,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,EAAE;QACtC,IAAI,EAAE;YACF,GAAG;gBACC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;YAChF,CAAC;SACJ;KACJ,CAAC,CAAC;IAEH,OAAoC,gBAAgB,CAAC;AACzD,CAAC"}
|
|
@@ -3,8 +3,8 @@ import { TFixedOptions } from './fixed-options';
|
|
|
3
3
|
export type TNativePlayoutAudioWorkletNodeOptions = Partial<Omit<TNativeAudioWorkletNodeOptions, TFixedOptions>> & {
|
|
4
4
|
numberOfChannels: number;
|
|
5
5
|
readPointerView: Uint8Array | Uint16Array | Uint32Array;
|
|
6
|
-
startView:
|
|
7
|
-
stopView:
|
|
6
|
+
startView: Uint16Array;
|
|
7
|
+
stopView: Uint16Array;
|
|
8
8
|
storageView: Float32Array;
|
|
9
9
|
writePointerView: Uint8Array | Uint16Array | Uint32Array;
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-playout-audio-worklet-node-options.d.ts","sourceRoot":"","sources":["../../../src/types/native-playout-audio-worklet-node-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,qCAAqC,GAAG,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,aAAa,CAAC,CAAC,GAAG;IAC/G,gBAAgB,EAAE,MAAM,CAAC;IAEzB,eAAe,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;IAExD,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"native-playout-audio-worklet-node-options.d.ts","sourceRoot":"","sources":["../../../src/types/native-playout-audio-worklet-node-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,qCAAqC,GAAG,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,aAAa,CAAC,CAAC,GAAG;IAC/G,gBAAgB,EAAE,MAAM,CAAC;IAEzB,eAAe,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;IAExD,SAAS,EAAE,WAAW,CAAC;IAEvB,QAAQ,EAAE,WAAW,CAAC;IAEtB,WAAW,EAAE,YAAY,CAAC;IAE1B,gBAAgB,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;CAC5D,CAAC"}
|
|
@@ -3,8 +3,8 @@ import { TFixedOptions } from './fixed-options';
|
|
|
3
3
|
export type TPlayoutAudioWorkletNodeOptions = Partial<Omit<IAudioWorkletNodeOptions, TFixedOptions>> & {
|
|
4
4
|
numberOfChannels: number;
|
|
5
5
|
readPointerView: Uint8Array | Uint16Array | Uint32Array;
|
|
6
|
-
startView:
|
|
7
|
-
stopView:
|
|
6
|
+
startView: Uint16Array;
|
|
7
|
+
stopView: Uint16Array;
|
|
8
8
|
storageView: Float32Array;
|
|
9
9
|
writePointerView: Uint8Array | Uint16Array | Uint32Array;
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playout-audio-worklet-node-options.d.ts","sourceRoot":"","sources":["../../../src/types/playout-audio-worklet-node-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,aAAa,CAAC,CAAC,GAAG;IACnG,gBAAgB,EAAE,MAAM,CAAC;IAEzB,eAAe,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;IAExD,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"playout-audio-worklet-node-options.d.ts","sourceRoot":"","sources":["../../../src/types/playout-audio-worklet-node-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,aAAa,CAAC,CAAC,GAAG;IACnG,gBAAgB,EAAE,MAAM,CAAC;IAEzB,eAAe,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;IAExD,SAAS,EAAE,WAAW,CAAC;IAEvB,QAAQ,EAAE,WAAW,CAAC;IAEtB,WAAW,EAAE,YAAY,CAAC;IAE1B,gBAAgB,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;CAC5D,CAAC"}
|
package/build/es5/bundle.js
CHANGED
|
@@ -58,13 +58,14 @@
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
var audioWorkletNode = new audioWorkletNodeConstructor(context, 'playout-audio-worklet-processor', _objectSpread(_objectSpread({}, options), fixedOptions));
|
|
61
|
+
var port = audioWorkletNode.port;
|
|
61
62
|
var _listener = function listener() {
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
port.removeEventListener('message', _listener);
|
|
64
|
+
port.close();
|
|
64
65
|
audioWorkletNode.dispatchEvent(new Event('ended'));
|
|
65
66
|
};
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
port.addEventListener('message', _listener);
|
|
68
|
+
port.start();
|
|
68
69
|
Object.defineProperties(audioWorkletNode, {
|
|
69
70
|
port: {
|
|
70
71
|
get: function get() {
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/runtime": "^7.28.4",
|
|
13
|
-
"playout-audio-worklet-processor": "^1.0.
|
|
13
|
+
"playout-audio-worklet-processor": "^1.0.1",
|
|
14
14
|
"standardized-audio-context": "^25.3.77",
|
|
15
15
|
"tslib": "^2.8.1"
|
|
16
16
|
},
|
|
@@ -20,30 +20,30 @@
|
|
|
20
20
|
"@babel/plugin-external-helpers": "^7.27.1",
|
|
21
21
|
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
22
22
|
"@babel/preset-env": "^7.28.5",
|
|
23
|
-
"@commitlint/cli": "^
|
|
24
|
-
"@commitlint/config-angular": "^
|
|
23
|
+
"@commitlint/cli": "^20.3.1",
|
|
24
|
+
"@commitlint/config-angular": "^20.3.1",
|
|
25
25
|
"@rollup/plugin-babel": "^6.1.0",
|
|
26
26
|
"@rollup/plugin-replace": "^6.0.3",
|
|
27
27
|
"@vitest/browser-webdriverio": "^4.0.16",
|
|
28
28
|
"babel-loader": "^10.0.0",
|
|
29
|
-
"chai": "^6.2.
|
|
29
|
+
"chai": "^6.2.2",
|
|
30
30
|
"commitizen": "^4.3.1",
|
|
31
31
|
"cz-conventional-changelog": "^3.3.0",
|
|
32
32
|
"eslint": "^8.57.0",
|
|
33
|
-
"eslint-config-holy-grail": "^61.0.
|
|
33
|
+
"eslint-config-holy-grail": "^61.0.4",
|
|
34
34
|
"husky": "^9.1.7",
|
|
35
35
|
"lint-staged": "^16.2.7",
|
|
36
36
|
"memfs": "^4.51.1",
|
|
37
37
|
"prettier": "^3.7.4",
|
|
38
38
|
"rimraf": "^6.1.2",
|
|
39
|
-
"rollup": "^4.
|
|
40
|
-
"sinon": "^21.0.
|
|
39
|
+
"rollup": "^4.55.1",
|
|
40
|
+
"sinon": "^21.0.1",
|
|
41
41
|
"sinon-chai": "^4.0.1",
|
|
42
42
|
"terser-webpack-plugin": "^5.3.16",
|
|
43
43
|
"ts-loader": "^9.5.4",
|
|
44
|
-
"tsconfig-holy-grail": "^15.0.
|
|
44
|
+
"tsconfig-holy-grail": "^15.0.3",
|
|
45
45
|
"tslint": "^6.1.3",
|
|
46
|
-
"tslint-config-holy-grail": "^56.0.
|
|
46
|
+
"tslint-config-holy-grail": "^56.0.7",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "^4.0.16",
|
|
49
49
|
"webpack": "^5.104.1",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"test:unit": "if [ \"$TYPE\" = \"\" -o \"$TYPE\" = \"unit\" ]; then npx vitest --config config/vitest/unit.ts; fi"
|
|
76
76
|
},
|
|
77
77
|
"types": "build/es2019/module.d.ts",
|
|
78
|
-
"version": "1.0.
|
|
78
|
+
"version": "1.0.3"
|
|
79
79
|
}
|
package/src/module.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function createPlayoutAudioWorkletNode<T extends TContext | TNativeContex
|
|
|
48
48
|
const fixedOptions: Required<Pick<TAnyAudioWorkletNodeOptions<T>, TFixedOptions>> = {
|
|
49
49
|
numberOfInputs: 0,
|
|
50
50
|
numberOfOutputs: 1,
|
|
51
|
-
outputChannelCount:
|
|
51
|
+
outputChannelCount: [numberOfChannels],
|
|
52
52
|
processorOptions: {
|
|
53
53
|
readPointerView,
|
|
54
54
|
startView,
|
|
@@ -61,14 +61,15 @@ export function createPlayoutAudioWorkletNode<T extends TContext | TNativeContex
|
|
|
61
61
|
...options,
|
|
62
62
|
...fixedOptions
|
|
63
63
|
});
|
|
64
|
+
const { port } = audioWorkletNode;
|
|
64
65
|
const listener = () => {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
port.removeEventListener('message', listener);
|
|
67
|
+
port.close();
|
|
67
68
|
audioWorkletNode.dispatchEvent(new Event('ended'));
|
|
68
69
|
};
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
port.addEventListener('message', listener);
|
|
72
|
+
port.start();
|
|
72
73
|
|
|
73
74
|
Object.defineProperties(audioWorkletNode, {
|
|
74
75
|
port: {
|
|
@@ -6,9 +6,9 @@ export type TNativePlayoutAudioWorkletNodeOptions = Partial<Omit<TNativeAudioWor
|
|
|
6
6
|
|
|
7
7
|
readPointerView: Uint8Array | Uint16Array | Uint32Array;
|
|
8
8
|
|
|
9
|
-
startView:
|
|
9
|
+
startView: Uint16Array;
|
|
10
10
|
|
|
11
|
-
stopView:
|
|
11
|
+
stopView: Uint16Array;
|
|
12
12
|
|
|
13
13
|
storageView: Float32Array;
|
|
14
14
|
|
|
@@ -6,9 +6,9 @@ export type TPlayoutAudioWorkletNodeOptions = Partial<Omit<IAudioWorkletNodeOpti
|
|
|
6
6
|
|
|
7
7
|
readPointerView: Uint8Array | Uint16Array | Uint32Array;
|
|
8
8
|
|
|
9
|
-
startView:
|
|
9
|
+
startView: Uint16Array;
|
|
10
10
|
|
|
11
|
-
stopView:
|
|
11
|
+
stopView: Uint16Array;
|
|
12
12
|
|
|
13
13
|
storageView: Float32Array;
|
|
14
14
|
|