Instantiate WebAssembly module using hard-coded BASE64 string.
Use this function to asynchronously initialize the library inside AudioWorklet.
// Inside audio worklet.import { ChunkedResampler, initWithBase64 } from 'lanczos-resampler/loader'(async () => { // N.B. Top-level `await`s aren't reliable in audio worklets. // This code should be moved to a more appropriate place. await initWithBase64() const resampler = new ChunkedResampler(44100, 48000) console.debug(resampler)})()class MyAudioProcessor extends AudioWorkletProcessor { // ...} Copy
// Inside audio worklet.import { ChunkedResampler, initWithBase64 } from 'lanczos-resampler/loader'(async () => { // N.B. Top-level `await`s aren't reliable in audio worklets. // This code should be moved to a more appropriate place. await initWithBase64() const resampler = new ChunkedResampler(44100, 48000) console.debug(resampler)})()class MyAudioProcessor extends AudioWorkletProcessor { // ...}
Instantiate WebAssembly module using hard-coded BASE64 string.
Use this function to asynchronously initialize the library inside AudioWorklet.
Example