concept · Web Audio API
Render Size Explorer
Create AudioContexts with different renderSizeHint values and read back the actual renderQuantumSize the browser honours. The explorer shows whether "hardware" differs from "default" on your device and how a numeric hint is rounded.
Checking AudioContext renderSizeHint support…
renderSizeHint: "default"
Always
128 frames — the standard Web Audio quantum, backward-compatible with all existing code.renderQuantumSize
—
renderSizeHint: "hardware"
The browser picks the quantum that best aligns with the audio hardware buffer — may be 128, 256, 512, or higher.
renderQuantumSize
—
renderSizeHint: <integer>
Request a specific quantum size. The browser may round to the nearest supported power-of-two.
renderQuantumSize
—
On most desktop systems,
"default" will return 128 and "hardware" may return the same 128 or a larger value like 256 depending on the OS audio subsystem. On macOS with CoreAudio, the hardware buffer is often 512 frames — and an AudioContext with renderSizeHint: "hardware" will match that, reducing resampling overhead. The actual chosen size is always readable from context.renderQuantumSize.
the API
// Chrome 151+: pass renderSizeHint to AudioContext
const ctx1 = new AudioContext({
renderSizeHint: 'default', // 128 frames (backward-compatible)
});
console.log(ctx1.renderQuantumSize); // 128
const ctx2 = new AudioContext({
renderSizeHint: 'hardware', // browser picks best size for hardware
});
console.log(ctx2.renderQuantumSize); // e.g. 128, 256, 512…
const ctx3 = new AudioContext({
renderSizeHint: 512, // request 512 frames
});
console.log(ctx3.renderQuantumSize); // may be rounded
see also
- Latency Benchmark — compare output latency across renderSizeHint values
- ChromeStatus entry
- MDN — AudioContext constructor