Back to Content

AudioWorkletGlobalScope: port

files/en-us/web/api/audioworkletglobalscope/port/index.md

latest1020 B
Original Source

{{APIRef("Web Audio API")}}{{SeeCompatTable}}

The port read-only property of the {{domxref("AudioWorkletGlobalScope")}} interface returns a {{domxref("MessagePort")}} object that can be used to send and receive messages between the main thread and the associated {{domxref("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 {{domxref("MessagePort")}} object that is connecting the AudioWorklet and its associated AudioWorkletGlobalScope.

Examples

See AudioWorkletNode.port for examples.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also