renderToWav

Renders a sound definition offline and encodes the result as a WAV blob. Combines renderToBuffer and bufferToWav in one call.

import { renderToWav } from "@web-kits/audio";

const blob = await renderToWav(definition, { duration: 1 });
const url = URL.createObjectURL(blob);

Signature

function renderToWav(
  definition: SoundDefinition,
  options: OfflineRenderOptions
): Promise<Blob>;

Uses the same OfflineRenderOptions as renderToBuffer.