← Chrome 158 reference

v158 · web audio · enabled by default

OfflineAudioContext incremental rendering

Limited availability — not Baseline

  • Chrome · 158
  • Edge · 158 (BCD mirrors Chrome)
  • Firefox · no
  • Safari · no

webstatus.dev reports the offline-audio-context-incremental-rendering web feature as Baseline limited, available only in Chrome and Chrome Android 158 (2026-11-17), per the webstatus.dev API record (queried 2026-11-22). The parent OfflineAudioContext interface itself is Baseline widely available; only the chunked behavior on this page is Chrome-only. See the full table.

OfflineAudioContext.startRendering() now takes an optional chunkSize argument. Each call renders at most that many sample-frames of the audio graph into a fresh AudioBuffer and resolves with it, so you can render, encode and discard audio a piece at a time instead of allocating the whole render up front. A context can also be created with length: null to render for an open-ended duration, and the new close() method stops such a render. Long exports — a two-hour stereo mix at 48 kHz is about 2.8 GB of float samples in one buffer — now fit in a few megabytes per chunk.

At a glance

Shipped inChrome 158 (desktop, Android, Android WebView; no iOS milestone recorded) — filed under “Enabled by default” in the milestone=158 listing; per-platform milestones from the ChromeStatus API record
Runtime flagOfflineAudioContextIncrementalRendering, status stable in Blink’s runtime_enabled_features.json5 (verified 2026-11-22). The flag gates startRendering(chunkSize), close() and constructing without a length.
Exposure[Exposed=Window] only — not in workers (Chromium also throws NotSupportedError “Workers are not supported.”)
SpecificationWeb Audio API 1.1 — startRendering(chunkSize); added by WebAudio/web-audio-api#2675, from proposal issue #2445
ExplainerMSEdgeExplainers — OfflineAudioContext incremental rendering (note: its length: Infinity sketch predates the shipped length: null design; see indefinite length)
Blink-devIntent to Prototype · Intent to Ship · TAG review #1282
Tracking bugissues.chromium.org/530596178
Web platform testsofflineaudiocontext-incremental-rendering.html · …-data-integrity.html · offlineaudiocontext-close.html
ChromeStatus5109900936085504 — OfflineAudioContext incremental rendering

Syntax

The OfflineAudioContext interface and its options dictionary as they now read in the Editor’s Draft (IDL verbatim, fetched 2026-11-22). The three changes from Web Audio 1.0 are the chunkSize argument, the nullable length (attribute and dictionary member) and the close() method:

[Exposed=Window]
interface OfflineAudioContext : BaseAudioContext {
    constructor(OfflineAudioContextOptions contextOptions);
    constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate);
    Promise<AudioBuffer> startRendering(optional unsigned long? chunkSize = null);
    Promise<undefined> resume();
    Promise<undefined> suspend(double suspendTime);
    Promise<undefined> close();
    readonly attribute unsigned long? length;
    attribute EventHandler oncomplete;
};

dictionary OfflineAudioContextOptions {
    unsigned long numberOfChannels = 1;
    unsigned long? length = null;
    required float sampleRate;
    (AudioContextRenderSizeCategory or unsigned long) renderSizeHint = "default";
};

Chromium declares the same surface as two overloads — startRendering() and a runtime-flagged startRendering(unsigned long? chunkSize) — with a TODO to collapse them into the spec’s single optional form; script sees no difference.

New and changed members
MemberWhat changed
startRendering(chunkSize)Optional chunkSize; may be called repeatedly; each call resolves with the next chunk of frames. Calls queue and resolve in order.
close()New. Stops rendering, rejects queued chunks with AbortError, moves state to "closed".
OfflineAudioContextOptions.lengthNow unsigned long?, default null: omit it for an open-ended render.
OfflineAudioContext.lengthNow nullable: null for an indefinite-length context.
Source: Web Audio API 1.1 §1.3 — The OfflineAudioContext Interface; §1.3.4 — OfflineAudioContextOptions; Chromium offline_audio_context.idl

How chunked rendering works

The context keeps two counters: committed frames (frames promised to some startRendering() call) and rendered frames. Each call works out a buffer length, allocates an AudioBuffer of exactly that length, adds it to a FIFO queue and returns a promise; the rendering thread fills the queued buffers one after another and resolves each promise with its buffer. The chunk length is decided at call time:

Length of the AudioBuffer each startRendering() call resolves with
Context lengthchunkSize omitted / nullchunkSize given
A number (finite render)All remaining frames — the classic one-shot renderchunkSize rounded up to a multiple of the render quantum size, trimmed to the frames still remaining
null, indefiniteOne render quantum (128 frames by default)chunkSize rounded up to a multiple of the render quantum size

A finite context closes itself once its final chunk has been delivered (and fires the legacy complete event with that final chunk); further startRendering() calls reject with InvalidStateError. An indefinite context never finishes on its own: you stop it with close(). Between chunks the graph does not advance, and state stays "running" — rendering simply waits for the next call. Full rules, including errors and the suspend() interaction, are on the startRendering(chunkSize) page.

Memory math. An AudioBuffer holds 32-bit floats, so a chunk costs numberOfChannels × frames × 4 bytes. Two hours of stereo at 48 kHz is 345,600,000 frames — 2,764,800,000 bytes as one buffer; ten-second chunks of 480,000 frames are 3,840,000 bytes each, and you can drop each one once it has been encoded or written.

Source: Web Audio API 1.1 §1.3.3 — startRendering(chunkSize) algorithm; Chromium offline_audio_context.cc; WPT offlineaudiocontext-incremental-rendering.html; motivation per the explainer

Feature detection

Passing an extra argument to an older startRendering() is silently ignored: an old build renders the whole buffer in one go and resolves once. Detect support before relying on chunks. The explainer recommends checking for close(), which Chromium gates behind the same runtime flag as chunkSize:

const supportsIncrementalRendering =
  typeof OfflineAudioContext !== 'undefined' &&
  'close' in OfflineAudioContext.prototype;
Source: “It’s possible to feature detect by checking for the presence of the close method” — explainer, Proposed Approach → Pros; shared RuntimeEnabled=OfflineAudioContextIncrementalRendering in Chromium offline_audio_context.idl

Examples

Exporting a long render in fixed-size chunks

const sampleRate = 48000;
const ctx = new OfflineAudioContext({
  numberOfChannels: 2,
  sampleRate,
  length: sampleRate * 60 * 60 * 2, // two hours, finite
});

// ...build the graph: sources, effects, ctx.destination...

const CHUNK = sampleRate * 10; // 480000 frames: a multiple of 128
let rendered = 0;
while (rendered < ctx.length) {
  const chunk = await ctx.startRendering(CHUNK); // AudioBuffer
  rendered += chunk.length;                      // last chunk is shorter
  await encodeAndWrite(chunk);                   // your encoder / file writer
}
console.log(ctx.state); // "closed" — a finite context closes itself

Rendering until you decide to stop

// No length: an indefinite-length context (ctx.length === null)
const ctx = new OfflineAudioContext({ numberOfChannels: 1, sampleRate: 44100 });
const osc = new OscillatorNode(ctx, { frequency: 440 });
osc.connect(ctx.destination);
osc.start();

while (ctx.currentTime < 30) {
  const chunk = await ctx.startRendering(4096); // 4096 frames per chunk
  analyse(chunk.getChannelData(0));
}
await ctx.close(); // required: an indefinite context never closes itself
Live example from the Chrome Platform Showcase (route HEAD-checked 200, 2026-11-22): render a real graph one chunk at a time and compare frames requested with frames received. Sibling concept demos (all 200): lifecycle and close(), memory math and WAV export pipeline.Source: chrome-platform-showcase
Source: snippets gendn-derived from the startRendering(chunkSize) algorithm and the explainer’s usage example (adapted from its length: Infinity to the shipped length: null); the author’s own sample page is linked from ChromeStatus

Browser compatibility

BCD api/OfflineAudioContext.json records close (tagged web-features:offline-audio-context-incremental-rendering, marked experimental) but has no sub-feature for the chunkSize argument or a nullable length (checked 2026-11-22). Those two columns are therefore interim, from ChromeStatus and the shared Chromium runtime flag.

Support for incremental rendering
Browserclose() (BCD)startRendering(chunkSize)length: null
Chrome158158 (interim: ChromeStatus)158 (interim: ChromeStatus)
Chrome Android158, mirrored158 (interim)158 (interim)
Android WebView158, mirrored158 (interim)158 (interim)
Edge158, mirroredUnknown — expected with Chromium 158, not separately recordedUnknown
FirefoxNoNoNo
Safari / iOSNoNoNo

Standards positions: Mozilla standards-positions#1456 (ChromeStatus records “Positive”, noting Mozilla reviewed the spec change, though no formal position is posted); WebKit standards-positions#724 (“No signal”). The OfflineAudioContext interface itself is Baseline widely available, so classic one-shot startRendering() remains the cross-browser fallback.

Source: BCD api/OfflineAudioContext.json; webstatus.dev API; web-features offline-audio-context-incremental-rendering.yml; ChromeStatus API record

Security and privacy

No permission, user gesture or secure context is required, and no new data reaches the page: chunks contain exactly the samples a one-shot render would have produced, only delivered in pieces. The practical effect is defensive — a page no longer needs a multi-gigabyte allocation (which the explainer notes can get the tab terminated) to render long audio. The Web Audio specification’s existing privacy considerations (fingerprinting via DSP output differences) apply unchanged to offline rendering; the sources read do not identify any new privacy surface from chunking. Member-level notes are on each child page.

Source: Web Audio API 1.1 §8 — Privacy Considerations; explainer — User-Facing Problem

Specifications

See also