v145 · Web Audio API · demo
Worklet Waveform
An AudioWorkletProcessor that generates a sine wave and reports how many frames it processes per callback. Pick a renderSizeHint and start the context — the waveform display and stats panel show the actual quantum size Chrome honours, the base latency, and how many worklet callbacks fire per second.
Chrome 145+ —
AudioContext({ renderSizeHint }) option. Older browsers ignore the option and lock to 128-frame quanta; the AudioWorklet still runs.
Pick a render size hint · click Start · watch the quantum-size stat and base latency · stop and try a different hint to compare
Hint used
—
renderQuantumSize
— frames
Base latency
— ms
Callbacks/sec
—
AudioContext log
—Click Start to create an AudioContext
// AudioContext renderSizeHint — Chrome 145 origin trial (stable M151)
// The quantum size affects AudioWorkletProcessor callback frequency and latency.
// Default: 128 frames (standard)
const ctx128 = new AudioContext();
// Hardware-aligned (browser picks the best quantum for the device)
const ctxHW = new AudioContext({ renderSizeHint: 'hardware' });
// Fixed quantum (browser may round to nearest power-of-two)
const ctx256 = new AudioContext({ renderSizeHint: 256 });
// Read actual quantum granted:
console.log(ctx256.renderQuantumSize); // e.g. 256
// AudioWorkletProcessor gets the chosen quantum in each process() call:
class MyProcessor extends AudioWorkletProcessor {
process(inputs, outputs) {
const frameCount = outputs[0][0].length; // equals renderQuantumSize
return true;
}
}
registerProcessor('my-proc', MyProcessor);