Intent to Ship: AudioContext Interrupted State

108 views
Skip to first unread message

Chromestatus

unread,
Mar 25, 2025, 4:57:34 PMMar 25
to blin...@chromium.org, gabrie...@microsoft.com, hong...@google.com, mjwi...@google.com, ste...@microsoft.com

Contact emails

gabrie...@microsoft.com, ste...@microsoft.com

Explainer

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/AudioContextInterruptedState/explainer.md

Specification

https://webaudio.github.io/web-audio-api/#dom-audiocontextstate-interrupted

Summary

The current Web Audio API lacks a mechanism for the User Agent (UA) to interrupt playback for scenarios such as exclusive audio access (VoIP) or when a laptop lid is closed. To address this, we propose adding an "interrupted" state to AudioContextState. This new state would allow the UA to pause playback in these scenarios and enable web applications to respond appropriately. 



Blink component

Blink>WebAudio

TAG review

https://github.com/w3ctag/design-reviews/issues/1069

TAG review status

Pending

Risks



Interoperability and Compatibility

When AudioContext.resume() is called for an AudioContext in the "closed" state, the returned promise is rejected. With this proposal, the same behavior will also happen when AudioContext.resume() is called while the AudioContext "interrupted". In this case, a web page that is not aware of the existence of the "interrupted" state might imply that the AudioContext has been closed. In this situation, application shouldn't rely solely on the returned promise resolution outcome and also check the AudioContext state.



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/1083) Mozilla helped review and merge this feature into the Web Audio specification

WebKit: Positive (https://github.com/WebKit/standards-positions/issues/410) Safari is supportive and already has a prototype implemented to support the Audio Session API.

Web developers: Positive (https://github.com/whatwg/html/issues/10208) Even though this feature has not been explicitly asked by web developers, it is required to make other in-development browser APIs to work properly with Web Audio - e.g. media-playback-while-not-visible permission policy and the Audio Session API.

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

No

This feature cannot be tested by itself because it cannot be used directly by web applications. An AudioContext should only transition to the "interrupted" state at the user agent's discretion - i.e. there is no public web API to interrupt the AudioContext. However, other Web APIs' specifications will depend on the "interrupted" state and can have web tests that expect the AudioContext to be interrupted in some situations: For example: - https://www.w3.org/TR/audio-session/ - https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/IframeMediaPause/iframe_media_pausing.md



Flag name on about://flags

None

Finch feature name

AudioContextInterruptedState

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/374805121

Estimated milestones

Shipping on desktop 136
Shipping on Android 136
Shipping on WebView 136


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

This feature has been added to the Web Audio spec: https://webaudio.github.io/web-audio-api/#dom-audiocontextstate-interrupted

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5172068166139904?gate=5204675557851136

Links to previous Intent discussions

Intent to Prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/GgSvU1BZZRU


This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Mar 26, 2025, 11:37:26 AMMar 26
to Chromestatus, blin...@chromium.org, gabrie...@microsoft.com, hong...@google.com, mjwi...@google.com, ste...@microsoft.com
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/67e318b0.170a0220.e1a1e.0863.GAE%40google.com.

TAMURA, Kent

unread,
Mar 28, 2025, 5:36:30 AMMar 28
to gabrie...@microsoft.com, blin...@chromium.org, Chromestatus, hong...@google.com, mjwi...@google.com, ste...@microsoft.com, Chris Harrelson

Mike Taylor

unread,
Mar 28, 2025, 9:57:27 AMMar 28
to TAMURA, Kent, gabrie...@microsoft.com, blin...@chromium.org, Chromestatus, hong...@google.com, mjwi...@google.com, ste...@microsoft.com, Chris Harrelson

LGTM3 - it's nice to see cross-vendor support for this.

Reply all
Reply to author
Forward
0 new messages