OfflineAudioContext incremental rendering
- Category
- Multimedia
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
WPT details: WPTs are being implemented in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-offlineaudiocontext-interface/: https://wpt.fyi/results/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-incremental-rendering.html?label=experimental&label=master&aligned https://wpt.fyi/results/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-incremental-rendering-data-integrity.html?label=experimental&label=master&aligned https://wpt.fyi/results/webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-close.html?label=experimental&label=master&aligned
Summary
This feature adds an incremental rendering mechanism to OfflineAudioContext so that the audio graph data can be incrementally processed rather than allocating the whole audio buffer up front. By incrementally delivering the data using data chunks, there is no need to have high memory requirements for the user's machine when processing high amounts of data.
Motivation
The OfflineAudioContext API works well for rendering small audio graphs, but it does not scale for larger projects because it allocates the full graph's AudioBuffer up front. For example, rendering a 2-hour video composition project in clipchamp.com in an OfflineAudioContext would require an extremely large AudioBuffer allocation. The implication of this API is that a user's computer must have enough available memory to export the project even if the in-memory audio buffer will eventually be discarded after it is written to a file. In situations with limited hardware resources or low-powered devices, this limitation makes WebAudio unusable as an offline processor. If memory capacity is exceeded on a user's machine, then the processing will stop and the browser may terminate the tab/window leading to potential loss of data for the user and a poor user experience.
Standards & signals
- Specification: https://webaudio.github.io/web-audio-api/#dom-offlineaudiocontext-startrendering
- Firefox: No signal — Although not officially "positive" in their GitHub repo, Mozilla position should be positive. They were very active in the WG and also reviewed and approved the spec changes.
- Safari: No signal
- Web developers: Positive — Developers from ClipChamp and Mediabunny participated in the spec discussions and support the feature.
- Tracking bug: https://issues.chromium.org/issues/530596178
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=webaudio%2Fthe-audio-api%2Fthe-offlineaudiocontext-interface%2Fofflineaudiocontext-incremental-rendering
- 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+OfflineAudioContext%20incremental%20rendering
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=OfflineAudioContext%20incremental%20rendering
- Baseline status: https://webstatus.dev/?q=OfflineAudioContext%20incremental%20rendering
Samples: https://gabrielsanbrito.github.io/demo_pages/oac-incremental-rendering
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/OfflineAudioContext/explainer.md