AudioWorkletGlobalScope: port

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{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](/en-US/docs/Web/API/AudioWorkletNode/port#examples) for examples.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • Web Audio API
  • Using the Web Audio API
  • Using AudioWorklet