timed-audio-buffer-source-node-audio-worklet 2.1.26 → 2.1.28
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const worklet = "(()=>{\"use strict\";class e extends AudioWorkletProcessor{constructor({numberOfInputs:e,numberOfOutputs:t,outputChannelCount:o,processorOptions:r}){var n;const s=\"object\"==typeof r&&null!==r&&\"buffer\"in r?r.buffer:null;if(!(null===s||Array.isArray(s)&&s.every(
|
|
1
|
+
export declare const worklet = "(()=>{\"use strict\";class e extends AudioWorkletProcessor{constructor({numberOfInputs:e,numberOfOutputs:t,outputChannelCount:o,processorOptions:r}){var n;const s=\"object\"==typeof r&&null!==r&&\"buffer\"in r?r.buffer:null;if(!(null===s||Array.isArray(s)&&s.every(e=>e instanceof Float32Array)))throw new Error(\"The buffer needs to be either null or an array with where each element is a Float32Array.\");if(1!==e)throw new Error(\"The numberOfInputs must be 1.\");if(1!==t)throw new Error(\"The numberOfOutputs must be 1.\");const i=null!==(n=null==s?void 0:s.length)&&void 0!==n?n:1;if(void 0===o||1!==o.length||i!==o[0])throw new Error(\"The outputChannelCount must match the number of channels of the buffer.\");const u=\"object\"==typeof r&&null!==r&&\"position\"in r?r.position:0;if(\"number\"!=typeof u)throw new Error('The position needs to be of type \"number\".');const h=\"object\"==typeof r&&null!==r&&\"timestamp\"in r?r.timestamp:0;if(\"number\"!=typeof h)throw new Error('The timestamp needs to be of type \"number\".');const l=\"object\"==typeof r&&null!==r&&\"velocity\"in r?r.velocity:0;if(\"number\"!=typeof l||![0,1].includes(l))throw new Error(\"The velocity needs to be either 0 or 1.\");super(),this._buffer=s,this._position=u,this._timestamp=h,this._velocity=l}process([e],[t]){if((null==e?void 0:e.length)>0){const[t]=e;t.length>1&&(this._position=Math.round(t[0]),this._timestamp=Math.round(t[1]),this._velocity=Math.round(t[2]))}if(null!==this._buffer){const e=this._buffer.length;for(let o=0;o<e;o+=1){const e=this._buffer[o],r=t[o];for(let t=0;t<128;t+=1){const o=this._position+(currentFrame-this._timestamp+t)*this._velocity;o>=0&&o<e.length&&(r[t]=e[o])}}}return!0}}e.parameterDescriptors=[],registerProcessor(\"timed-audio-buffer-source-node-audio-worklet-processor\",e)})();";
|
|
2
2
|
//# sourceMappingURL=worklet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worklet.d.ts","sourceRoot":"","sources":["../../../src/worklet/worklet.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"worklet.d.ts","sourceRoot":"","sources":["../../../src/worklet/worklet.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,uxDAA+uD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// This is the minified and stringified code of the timed-audio-buffer-source-node-audio-worklet-processor package.
|
|
2
|
-
export const worklet = `(()=>{"use strict";class e extends AudioWorkletProcessor{constructor({numberOfInputs:e,numberOfOutputs:t,outputChannelCount:o,processorOptions:r}){var n;const s="object"==typeof r&&null!==r&&"buffer"in r?r.buffer:null;if(!(null===s||Array.isArray(s)&&s.every(
|
|
2
|
+
export const worklet = `(()=>{"use strict";class e extends AudioWorkletProcessor{constructor({numberOfInputs:e,numberOfOutputs:t,outputChannelCount:o,processorOptions:r}){var n;const s="object"==typeof r&&null!==r&&"buffer"in r?r.buffer:null;if(!(null===s||Array.isArray(s)&&s.every(e=>e instanceof Float32Array)))throw new Error("The buffer needs to be either null or an array with where each element is a Float32Array.");if(1!==e)throw new Error("The numberOfInputs must be 1.");if(1!==t)throw new Error("The numberOfOutputs must be 1.");const i=null!==(n=null==s?void 0:s.length)&&void 0!==n?n:1;if(void 0===o||1!==o.length||i!==o[0])throw new Error("The outputChannelCount must match the number of channels of the buffer.");const u="object"==typeof r&&null!==r&&"position"in r?r.position:0;if("number"!=typeof u)throw new Error('The position needs to be of type "number".');const h="object"==typeof r&&null!==r&&"timestamp"in r?r.timestamp:0;if("number"!=typeof h)throw new Error('The timestamp needs to be of type "number".');const l="object"==typeof r&&null!==r&&"velocity"in r?r.velocity:0;if("number"!=typeof l||![0,1].includes(l))throw new Error("The velocity needs to be either 0 or 1.");super(),this._buffer=s,this._position=u,this._timestamp=h,this._velocity=l}process([e],[t]){if((null==e?void 0:e.length)>0){const[t]=e;t.length>1&&(this._position=Math.round(t[0]),this._timestamp=Math.round(t[1]),this._velocity=Math.round(t[2]))}if(null!==this._buffer){const e=this._buffer.length;for(let o=0;o<e;o+=1){const e=this._buffer[o],r=t[o];for(let t=0;t<128;t+=1){const o=this._position+(currentFrame-this._timestamp+t)*this._velocity;o>=0&&o<e.length&&(r[t]=e[o])}}}return!0}}e.parameterDescriptors=[],registerProcessor("timed-audio-buffer-source-node-audio-worklet-processor",e)})();`; // tslint:disable-line:max-line-length
|
|
3
3
|
//# sourceMappingURL=worklet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worklet.js","sourceRoot":"","sources":["../../../src/worklet/worklet.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"worklet.js","sourceRoot":"","sources":["../../../src/worklet/worklet.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,CAAC,MAAM,OAAO,GAAG,4uDAA4uD,CAAC,CAAC,sCAAsC"}
|
package/build/es5/bundle.js
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
// This is the minified and stringified code of the timed-audio-buffer-source-node-audio-worklet-processor package.
|
|
76
|
-
var worklet = "(()=>{var e={45:(e,t,r)=>{var o=r(738).default;e.exports=function(e,t){if(\"object\"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||\"default\");if(\"object\"!=o(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},72:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var o=r(79);e.exports=function(e,t){if(e){if(\"string\"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return\"Object\"===r&&e.constructor&&(r=e.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(e):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=r){var o,n,u,s,i=[],p=!0,l=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;p=!1}else for(;!(p=(o=u.call(r)).done)&&(i.push(o.value),i.length!==t);p=!0);}catch(e){l=!0,n=e}finally{try{if(!p&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw n}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},383:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")},e.exports.__esModule=!0,e.exports.default=e.exports},452:(e,t,r)=>{var o=r(738).default,n=r(475);e.exports=function(e,t){if(t&&(\"object\"==o(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},475:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e},e.exports.__esModule=!0,e.exports.default=e.exports},511:(e,t,r)=>{var o=r(636);e.exports=function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&o(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},550:e=>{function t(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],
|
|
76
|
+
var worklet = "(()=>{var e={45:(e,t,r)=>{var o=r(738).default;e.exports=function(e,t){if(\"object\"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||\"default\");if(\"object\"!=o(n))return n;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},72:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var o=r(79);e.exports=function(e,t){if(e){if(\"string\"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return\"Object\"===r&&e.constructor&&(r=e.constructor.name),\"Map\"===r||\"Set\"===r?Array.from(e):\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null!=r){var o,n,u,s,i=[],p=!0,l=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;p=!1}else for(;!(p=(o=u.call(r)).done)&&(i.push(o.value),i.length!==t);p=!0);}catch(e){l=!0,n=e}finally{try{if(!p&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw n}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},383:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")},e.exports.__esModule=!0,e.exports.default=e.exports},452:(e,t,r)=>{var o=r(738).default,n=r(475);e.exports=function(e,t){if(t&&(\"object\"==o(t)||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},475:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e},e.exports.__esModule=!0,e.exports.default=e.exports},511:(e,t,r)=>{var o=r(636);e.exports=function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,\"prototype\",{writable:!1}),t&&o(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},550:e=>{function t(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(e.exports=t=function(){return!!r},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var o=r(736);function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,\"prototype\",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},636:e=>{function t(r,o){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},646:(e,t,r)=>{var o=r(550),n=r(636);e.exports=function(e,t,r){if(o())return Reflect.construct.apply(null,arguments);var u=[null];u.push.apply(u,t);var s=new(e.bind.apply(e,u));return r&&n(s,r.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports},691:e=>{e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf(\"[native code]\")}catch(t){return\"function\"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var o=r(987),n=r(156),u=r(122),s=r(752);e.exports=function(e,t){return o(e)||n(e,t)||u(e,t)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var o=r(738).default,n=r(45);e.exports=function(e){var t=n(e,\"string\");return\"symbol\"==o(t)?t:t+\"\"},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")},e.exports.__esModule=!0,e.exports.default=e.exports},783:function(e,t,r){!function(e,t,r,o,n,u,s,i){\"use strict\";function p(e,t,r){return t=u(t),n(e,l()?Reflect.construct(t,[],u(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}var a=function(n){function u(e){var o,n,s=e.numberOfInputs,i=e.numberOfOutputs,l=e.outputChannelCount,a=e.processorOptions;r(this,u);var f=\"object\"===t(a)&&null!==a&&\"buffer\"in a?a.buffer:null;if(!(null===f||Array.isArray(f)&&f.every(function(e){return e instanceof Float32Array})))throw new Error(\"The buffer needs to be either null or an array with where each element is a Float32Array.\");if(1!==s)throw new Error(\"The numberOfInputs must be 1.\");if(1!==i)throw new Error(\"The numberOfOutputs must be 1.\");var c=null!==(n=null==f?void 0:f.length)&&void 0!==n?n:1;if(void 0===l||1!==l.length||c!==l[0])throw new Error(\"The outputChannelCount must match the number of channels of the buffer.\");var x=\"object\"===t(a)&&null!==a&&\"position\"in a?a.position:0;if(\"number\"!=typeof x)throw new Error('The position needs to be of type \"number\".');var d=\"object\"===t(a)&&null!==a&&\"timestamp\"in a?a.timestamp:0;if(\"number\"!=typeof d)throw new Error('The timestamp needs to be of type \"number\".');var y=\"object\"===t(a)&&null!==a&&\"velocity\"in a?a.velocity:0;if(\"number\"!=typeof y||![0,1].includes(y))throw new Error(\"The velocity needs to be either 0 or 1.\");return(o=p(this,u))._buffer=f,o._position=x,o._timestamp=d,o._velocity=y,o}return s(u,n),o(u,[{key:\"process\",value:function(t,r){var o=e(t,1)[0],n=e(r,1)[0];if((null==o?void 0:o.length)>0){var u=e(o,1)[0];u.length>1&&(this._position=Math.round(u[0]),this._timestamp=Math.round(u[1]),this._velocity=Math.round(u[2]))}if(null!==this._buffer)for(var s=this._buffer.length,i=0;i<s;i+=1)for(var p=this._buffer[i],l=n[i],a=0;a<128;a+=1){var f=this._position+(currentFrame-this._timestamp+a)*this._velocity;f>=0&&f<p.length&&(l[a]=p[f])}return!0}}])}(i(AudioWorkletProcessor));a.parameterDescriptors=[],registerProcessor(\"timed-audio-buffer-source-node-audio-worklet-processor\",a)}(r(715),r(738),r(383),r(579),r(452),r(72),r(511),r(837))},837:(e,t,r)=>{var o=r(72),n=r(636),u=r(691),s=r(646);function i(t){var r=\"function\"==typeof Map?new Map:void 0;return e.exports=i=function(e){if(null===e||!u(e))return e;if(\"function\"!=typeof e)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return s(e,arguments,o(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,i(t)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var u=t[o]={exports:{}};return e[o].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{\"use strict\";r(783)})()})();"; // tslint:disable-line:max-line-length
|
|
77
77
|
|
|
78
78
|
var blob = new Blob([worklet], {
|
|
79
79
|
type: 'application/javascript; charset=utf-8'
|
|
@@ -81,22 +81,22 @@
|
|
|
81
81
|
var addTimedAudioBufferSourceNodeAudioWorkletModule = /*#__PURE__*/function () {
|
|
82
82
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(addAudioWorkletModule) {
|
|
83
83
|
var url;
|
|
84
|
-
return _regeneratorRuntime.wrap(function
|
|
84
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
85
85
|
while (1) switch (_context.prev = _context.next) {
|
|
86
86
|
case 0:
|
|
87
87
|
url = URL.createObjectURL(blob);
|
|
88
88
|
_context.prev = 1;
|
|
89
|
-
_context.next =
|
|
89
|
+
_context.next = 2;
|
|
90
90
|
return addAudioWorkletModule(url);
|
|
91
|
-
case
|
|
92
|
-
_context.prev =
|
|
91
|
+
case 2:
|
|
92
|
+
_context.prev = 2;
|
|
93
93
|
URL.revokeObjectURL(url);
|
|
94
|
-
return _context.finish(
|
|
95
|
-
case
|
|
94
|
+
return _context.finish(2);
|
|
95
|
+
case 3:
|
|
96
96
|
case "end":
|
|
97
97
|
return _context.stop();
|
|
98
98
|
}
|
|
99
|
-
}, _callee, null, [[1,,
|
|
99
|
+
}, _callee, null, [[1,, 2, 3]]);
|
|
100
100
|
}));
|
|
101
101
|
return function addTimedAudioBufferSourceNodeAudioWorkletModule(_x) {
|
|
102
102
|
return _ref.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"description": "This module provides a loader for the TimedAudioBufferSourceNodeAudioWorkletProcessor and the corresponding TimedAudioBufferSourceNodeAudioWorkletNode.",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@babel/core": "^7.
|
|
20
|
+
"@babel/core": "^7.28.0",
|
|
21
21
|
"@babel/plugin-external-helpers": "^7.27.1",
|
|
22
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
23
|
-
"@babel/preset-env": "^7.
|
|
22
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
23
|
+
"@babel/preset-env": "^7.28.0",
|
|
24
24
|
"@commitlint/cli": "^19.8.1",
|
|
25
25
|
"@commitlint/config-angular": "^19.8.1",
|
|
26
26
|
"@rollup/plugin-babel": "^6.0.4",
|
|
@@ -30,7 +30,7 @@
|
|
|
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": "^60.0.
|
|
33
|
+
"eslint-config-holy-grail": "^60.0.37",
|
|
34
34
|
"husky": "^9.1.7",
|
|
35
35
|
"karma": "^6.4.4",
|
|
36
36
|
"karma-chrome-launcher": "^3.2.0",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"karma-sinon-chai": "^2.0.2",
|
|
41
41
|
"karma-webkit-launcher": "^2.6.0",
|
|
42
42
|
"karma-webpack": "^5.0.1",
|
|
43
|
-
"lint-staged": "^
|
|
43
|
+
"lint-staged": "^16.1.2",
|
|
44
44
|
"memfs": "^4.17.2",
|
|
45
|
-
"mocha": "^11.
|
|
46
|
-
"prettier": "^3.
|
|
45
|
+
"mocha": "^11.7.1",
|
|
46
|
+
"prettier": "^3.6.2",
|
|
47
47
|
"rimraf": "^6.0.1",
|
|
48
|
-
"rollup": "^4.
|
|
48
|
+
"rollup": "^4.45.1",
|
|
49
49
|
"sinon": "^17.0.1",
|
|
50
50
|
"sinon-chai": "^3.7.0",
|
|
51
51
|
"terser-webpack-plugin": "^5.3.14",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"tslint": "^6.1.3",
|
|
55
55
|
"tslint-config-holy-grail": "^56.0.6",
|
|
56
56
|
"typescript": "^5.8.3",
|
|
57
|
-
"webpack": "^5.
|
|
57
|
+
"webpack": "^5.100.2",
|
|
58
58
|
"webpack-cli": "^6.0.1"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"test:unit": "if [ \"$TYPE\" = \"\" -o \"$TYPE\" = \"unit\" ]; then karma start config/karma/config-unit.js --single-run; fi"
|
|
84
84
|
},
|
|
85
85
|
"types": "build/es2019/module.d.ts",
|
|
86
|
-
"version": "2.1.
|
|
86
|
+
"version": "2.1.28"
|
|
87
87
|
}
|
package/src/worklet/worklet.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This is the minified and stringified code of the timed-audio-buffer-source-node-audio-worklet-processor package.
|
|
2
|
-
export const worklet = `(()=>{"use strict";class e extends AudioWorkletProcessor{constructor({numberOfInputs:e,numberOfOutputs:t,outputChannelCount:o,processorOptions:r}){var n;const s="object"==typeof r&&null!==r&&"buffer"in r?r.buffer:null;if(!(null===s||Array.isArray(s)&&s.every(
|
|
2
|
+
export const worklet = `(()=>{"use strict";class e extends AudioWorkletProcessor{constructor({numberOfInputs:e,numberOfOutputs:t,outputChannelCount:o,processorOptions:r}){var n;const s="object"==typeof r&&null!==r&&"buffer"in r?r.buffer:null;if(!(null===s||Array.isArray(s)&&s.every(e=>e instanceof Float32Array)))throw new Error("The buffer needs to be either null or an array with where each element is a Float32Array.");if(1!==e)throw new Error("The numberOfInputs must be 1.");if(1!==t)throw new Error("The numberOfOutputs must be 1.");const i=null!==(n=null==s?void 0:s.length)&&void 0!==n?n:1;if(void 0===o||1!==o.length||i!==o[0])throw new Error("The outputChannelCount must match the number of channels of the buffer.");const u="object"==typeof r&&null!==r&&"position"in r?r.position:0;if("number"!=typeof u)throw new Error('The position needs to be of type "number".');const h="object"==typeof r&&null!==r&&"timestamp"in r?r.timestamp:0;if("number"!=typeof h)throw new Error('The timestamp needs to be of type "number".');const l="object"==typeof r&&null!==r&&"velocity"in r?r.velocity:0;if("number"!=typeof l||![0,1].includes(l))throw new Error("The velocity needs to be either 0 or 1.");super(),this._buffer=s,this._position=u,this._timestamp=h,this._velocity=l}process([e],[t]){if((null==e?void 0:e.length)>0){const[t]=e;t.length>1&&(this._position=Math.round(t[0]),this._timestamp=Math.round(t[1]),this._velocity=Math.round(t[2]))}if(null!==this._buffer){const e=this._buffer.length;for(let o=0;o<e;o+=1){const e=this._buffer[o],r=t[o];for(let t=0;t<128;t+=1){const o=this._position+(currentFrame-this._timestamp+t)*this._velocity;o>=0&&o<e.length&&(r[t]=e[o])}}}return!0}}e.parameterDescriptors=[],registerProcessor("timed-audio-buffer-source-node-audio-worklet-processor",e)})();`; // tslint:disable-line:max-line-length
|