AudioWorkletGlobalScope: port

The port read-only property of the AudioWorkletGlobalScope interface returns a MessagePort object that can be used to send and receive messages between the main thread and the associated AudioWorklet.

This allows for custom, asynchronous communication between code in the main thread and the global scope of an audio worklet, such as sending control data or global settings.

Value

The MessagePort object that is connecting the AudioWorklet and its associated AudioWorkletGlobalScope.

Examples

See AudioWorkletNode.port for examples.

Specifications

Specification
Web Audio API
# dom-audioworkletglobalscope-port

Browser compatibility

See also