Web Audio Render Capacity API
- Category
- Capabilities (Fugu)
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- Prepare to ship
Summary
Web Audio Render Capacity API is a way preemptively determine audio thread overload. Generally, the Web Audio renderer’s performance is affected by the machine speed and the computational load of an audio graph. However, Web Audio API does not expose a way to monitor the computational load, and it leaves developers no options to detect glitches that are the essential part of UX in audio applications. This API provides developers with a “glitch indicator”.
Motivation
By design, Web Audio API allows developers to form an “audio graph” dynamically for real-time sound processing synthesis . This graph is processed by the Web Audio renderer that calculates a block of audio data upon a callback invoked by the browser audio infrastructure. This is the basis of the “soft real-time system” in the Web Audio renderer; the current callback must be completed before the next one arrives. Otherwise, it misses the deadline from the audio infrastructure resulting in audible audio glitches (clicking/popping noises) in the audio stream. (See this for a more detailed description) Generally, the Web Audio renderer’s performance is affected by the machine speed and the computational load of an audio graph. However, Web Audio API does not expose a way to monitor the computational load, and it leaves developers no options to detect glitches that are the essential part of UX in audio applications. Providing developers with a “glitch indicator” is getting more important because the scale of audio applications grows larger and more complex. A large-scale music production app or a teleconferencing app can detect if it is suffering from the low audio performance, and can try to cut down the resource to avoid audio glitches
Standards & signals
- Specification: https://webaudio.github.io/web-audio-api/#AudioRenderCapacity
- Firefox: Positive — The current spec is the outcome of the discussion with Mozilla.
- Safari: No signal
- Web developers: Positive — 81 comments on the spec discussion including multiple positive feedback from developers.
- Tracking bug: https://crbug.com/1216181
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=web-audio-render-capacity-api
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Web%20Audio%20Render%20Capacity%20API
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Web%20Audio%20Render%20Capacity%20API
- Baseline status: https://webstatus.dev/?q=Web%20Audio%20Render%20Capacity%20API
Explainers: https://bit.ly/render-capacity-explainer