← Chrome 153 reference

v153 · web audio · performance

WebAudio: Configurable render quantum

Chrome 153 adds a renderSizeHint option to AudioContext and OfflineAudioContext, allowing developers to request a specific number of audio frames per render cycle — enabling trade-offs between latency and CPU overhead for their workload.

at a glance

Shipped inChrome 153 (Enabled by default)
StatusEnabled by default
SpecWeb Audio API §renderQuantumSize
Standards position (Firefox)No signal
Standards position (Safari)No signal
ChromeStatus5078190552907776 — WebAudio: Configurable render quantum
Source: chromestatus.com/feature/5078190552907776

why it exists

The Web Audio API has always rendered audio in fixed 128-frame chunks (the render quantum). This gives a latency of about 2.9 ms at 44.1 kHz. While 128 frames is fine for most applications, it creates tensions at both ends of the spectrum:

The renderSizeHint option lets the developer express a preference; the browser uses it as a hint, rounding to a supported size if necessary.

Source: chromestatus feature summary; Web Audio API spec

shape of the API

OptionContextTypeValues
renderSizeHintAudioContextOptions, OfflineAudioContextOptionsnumber | "default" | "hardware" integer → request that many frames per quantum
"default" → use 128 (same as before)
"hardware" → let the UA pick the optimal size
Read-only propertyContextDescription
BaseAudioContext.renderQuantumSizeAudioContext, OfflineAudioContextThe actual quantum size the browser selected
Source: Web Audio API §renderQuantumSize

example

// Low-latency synth: request small quantum (lower latency, more CPU)
const ctx = new AudioContext({ renderSizeHint: 32 });
console.log(ctx.renderQuantumSize); // e.g. 32 or the next supported size

// Batch processor: request large quantum (less CPU, higher latency)
const offCtx = new OfflineAudioContext({
  numberOfChannels: 2,
  length: 44100 * 10,  // 10 seconds
  sampleRate: 44100,
  renderSizeHint: 1024,
});
console.log(offCtx.renderQuantumSize); // e.g. 1024

// Let the UA decide the optimal size
const hwCtx = new AudioContext({ renderSizeHint: 'hardware' });

// AudioWorklet: renderQuantumSize is exposed in the worklet processor
class MyProcessor extends AudioWorkletProcessor {
  process(inputs, outputs) {
    // this.context.renderQuantumSize tells you how many frames you get
    return true;
  }
}
Source: Web Audio API spec

browser support

BrowserSupportNotes
Chrome 153+Enabled by defaultAll platforms
FirefoxNo signal
SafariNo signal
Source: chromestatus.com/feature/5078190552907776

see also