var p=Object.defineProperty;var w=(s,r,t)=>r in s?p(s,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[r]=t;var n=(s,r,t)=>(w(s,typeof r!="symbol"?r+"":r,t),t);class y extends AudioWorkletProcessor{constructor(){super();n(this,"bufferSize",2048);n(this,"_bytesWritten",0);n(this,"_buffer",new Float32Array(this.bufferSize));this.initBuffer()}initBuffer(){this._bytesWritten=0}isBufferEmpty(){return this._bytesWritten===0}isBufferFull(){return this._bytesWritten===this.bufferSize}process(t){return this.append(t[0][0]),!0}append(t){if(this.isBufferFull()&&this.flush(),!!t)for(let e=0;ee)throw"downsampling rate show be smaller than original sample rate";const h=e/u,_=Math.round(t.length/h),o=new Int16Array(_);let i=0,l=0;for(;i