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