Contact emails
[email protected], [email protected]

Explainer
https://github.com/WebAudio/web-audio-api/issues/2456
https://github.com/WebAudio/web-audio-api/pull/2507


Specification
https://webaudio.github.io/web-audio-api/#dom-audioworklet-port


Design docs

https://developer.mozilla.org/docs/Web/API/AudioWorkletGlobalScope/port


Summary
Exposes a shared MessagePort on AudioWorklet and AudioWorkletGlobalScope. This 
lets web applications communicate directly between the main thread AudioWorklet 
and the AudioWorkletGlobalScope without creating a bootstrap 
AudioWorkletProcessor only for message passing.


Blink component
Blink>WebAudio


Web Feature ID
audio-worklet


Motivation
The Web Audio specification defines a shared MessagePort on AudioWorklet and 
AudioWorkletGlobalScope. This lets web applications communicate directly 
between the main thread and the AudioWorkletGlobalScope without creating a 
bootstrap AudioWorkletProcessor or AudioWorkletNode only for message passing. 
Without this capability, developers have to keep workaround code that 
instantiates dummy processors solely to transfer initialization data or control 
messages into the worklet global scope. This adds code complexity and runtime 
overhead, and prevents cleanup of compatibility hacks in upstream projects. 
This change aligns Chromium with the current Web Audio specification and 
existing interoperable behavior. It also restores compatibility for real-world 
code that expects audioContext.audioWorklet.port to exist, including 
Emscripten-generated applications and demos such as the MOD player discussed in 
the linked issue. Relevant specification and ecosystem discussion: - 
https://github.com/WebAudio/web-audio-api/issues/2456 - 
https://github.com/WebAudio/web-audio-api/pull/2507 - 
https://github.com/emscripten-core/emscripten/pull/25354


Initial public proposal
No information provided


TAG review
N/A - Small additive WebAudio change that already shipped in Firefox 138.


TAG review status
Not applicable


Goals for experimentation
None


Risks




Interoperability and Compatibility
Low Risk. This feature adds a readonly port attribute to existing 
AudioWorkletGlobalScope and AudioWorklet. This feature has been defined in the 
WebAudio Spec 
(https://www.w3.org/TR/webaudio-1.1/#dom-audioworkletglobalscope-port) and has 
already shipped in Firefox 138.

Gecko: Shipped/Shipping 
(https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope/port) 
Shipped in Firefox 138

WebKit: No signal (https://bugs.webkit.org/show_bug.cgi?id=299386)

Web developers: Positive 
(https://github.com/emscripten-core/emscripten/pull/25354)

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?
No risk. Does not change WebView behaviour. Adds MessagePort to existing 
WebAudio API in AudioWorklet and AudioWorkletGlobalScope.



Debuggability
AudioWorkletGlobalScope.port and AudioWorklet.port are standard MessagePort 
instances and can be inspected via existing DevTools console and script break 
points.


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?
Yes
https://wpt.fyi/results/webaudio/the-audio-api/the-audioworklet-interface/audioworklet-messageport.https.html


Flag name on about://flags
enable-experimental-web-platform-features


Finch feature name
AudioWorkletSharedPort


Rollout plan
Will ship enabled for all users


Requires code in //chrome?
False


Tracking bug
https://issues.chromium.org/issues/446920095


Estimated milestones


Shipping on desktop 159

Shipping on Android 159

Shipping on WebView 159




Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop 
issues. Please list open issues (eg links to known github issues in the project 
for the feature specification) whose resolution may introduce web 
compat/interop risk (eg, changing to naming or structure of the API in a 
non-backward-compatible way).
Already part of W3C WebAudio 
https://www.w3.org/TR/webaudio-1.1/#dom-audioworkletglobalscope-port


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5079784523694080?gate=5773264841474048


Links to previous Intent discussions
Intent to Prototype: 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/69cca30d.050a0220.219f27.0c37.GAE%40google.com



This intent message was generated by Chrome Platform Status.

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6aea48de.e5ec2bf0.2ba4f6.01b9.GAE%40google.com.

Reply via email to