(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:String(r)}function r(t,r,n){return(r=e(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function n(t,e){return new Array(e).fill(t)}let i=function(t){return t.Timekeep="timekeep",t.AmplitudeMark="amplitude_mark",t}({});n(0,39);function o(t,e,r){const n=(t-e)/(r-e);return Number.isNaN(n)?0:n}const u=16;function s(t){return Math.round((t+Number.EPSILON)*u)/u}class c extends AudioWorkletProcessor{constructor(...t){super(...t),r(this,"nextAmplitudeSecond",0),r(this,"amplitudeIndex",0)}process(t,e,r){const n=s(currentTime);if(n===this.nextAmplitudeSecond||0===this.nextAmplitudeSecond){const e=t[0][0],r=Math.min(...e),c=o(Math.max(...e),-1,1)-o(r,-1,1);this.port.postMessage({ev:i.AmplitudeMark,amplitude:c,forIndex:this.amplitudeIndex++}),this.nextAmplitudeSecond=s(n+1/u)}return this.port.postMessage({ev:i.Timekeep,timeSeconds:currentTime}),!0}}registerProcessor("mx-voice-worklet",c)})();
//# sourceMappingURL=recorder.worklet.js.map