the URL where the code can be downlaoded
fetch options
// Inside web worker.
import codeURL from 'lanczos-resampler/code.wasm?url' // Vite.
import { ChunkedResampler, initWithFetch } from 'lanczos-resampler/loader';
(async () => {
// N.B. Any messages that are sent to the worker during top-level `await` are lost.
// Hence this code should be moved to a different scope.
await initWithFetch(codeURL);
const resampler = new ChunkedResampler(44100, 48000);
console.log(resampler);
})()
Instantiate WebAssembly module by fetching the code from the provided URL.
Use this function to asynchronously initialize the library inside Web Worker or in the main thread.