!(function () { 'use strict'; self.onmessage = function (a) { const t = a.data; const e = t.type; const r = t.data; let o = r; if (e === 'init') { const n = r.fromSampleRate; const l = r.toSampleRate; return self.fromSampleRate = n, void (self.toSampleRate = l) } if (e === 'base64' && (o = atob(r)), typeof o == 'string') { for (var f = new Uint8Array(o.length + o.length % 2), i = 0; i < o.length; ++i)f[i] = o.charCodeAt(i); o = new Int16Array(f.buffer) } const s = o; e !== 'Float32Array' && (o = (function (a) { for (var t = [], e = 0; e < a.length; e++) { const r = a[e] < 0 ? a[e] / 32768 : a[e] / 32767; t.push(r) } return new Float32Array(t) }(o))), o = (function (a, t, e) { const r = Math.round(a.length * (e / t)); const o = new Float32Array(r); const n = (a.length - 1) / (r - 1); o[0] = a[0]; for (let l = 1; l < r - 1; l++) { const f = l * n; const i = Math.floor(f).toFixed(); const s = Math.ceil(f).toFixed(); const u = f - i; o[l] = a[i] + (a[s] - a[i]) * u } return o[r - 1] = a[a.length - 1], o }(o, self.fromSampleRate, self.toSampleRate)), self.postMessage({ audioData: o, pcmAudioData: s }) } }())
