Initialize the library using WebAssembly instance exports.
Use this function to asynchronously initialize the library. This function is a simple setter that doesn't involve WebAssembly compilation.
import { ChunkedResampler, IMPORT_OBJECT, initWithExports } from 'lanczos-resampler/loader'import codeURL from 'lanczos-resampler/code.wasm?url' // Vite.const result = await WebAssembly.instantiateStreaming(fetch(codeURL), IMPORT_OBJECT)initWithExports(result.instance.exports)const resampler = new ChunkedResampler(44100, 48000)console.debug(resampler) Copy
import { ChunkedResampler, IMPORT_OBJECT, initWithExports } from 'lanczos-resampler/loader'import codeURL from 'lanczos-resampler/code.wasm?url' // Vite.const result = await WebAssembly.instantiateStreaming(fetch(codeURL), IMPORT_OBJECT)initWithExports(result.instance.exports)const resampler = new ChunkedResampler(44100, 48000)console.debug(resampler)
Initialize the library using WebAssembly instance exports.
Use this function to asynchronously initialize the library. This function is a simple setter that doesn't involve WebAssembly compilation.
Example