function s(e){const r=new Int16Array(e.length);for(let t=0;t<e.length;t++){const o=Math.max(-1,Math.min(1,e[t]));r[t]=o<0?Math.round(o*32768):Math.round(o*32767)}return r}function n(e){if(e.length===0)return 0;let r=0;for(let t=0;t<e.length;t++)r+=e[t]*e[t];return Math.sqrt(r/e.length)}const c="pcm-capture";class l extends AudioWorkletProcessor{process(r){const t=r[0]?.[0];if(!t||t.length===0)return!0;const o=s(t);return this.port.postMessage({pcm:o,level:n(t)},[o.buffer]),!0}}registerProcessor(c,l);
//# sourceMappingURL=pcm-capture.worklet-BtmM79sr.js.map
