docs.rodeo

MDN Web Docs mirror

BaseAudioContext: listener property

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

The listener property of the {{ domxref("BaseAudioContext") }}  interface returns an {{ domxref("AudioListener") }}  object that can then be used for implementing 3D audio spatialization.

Value

An {{ domxref("AudioListener") }}  object.

Examples

[!NOTE] For a full Web Audio spatialization example, see our panner-node demo.

const audioCtx = new AudioContext();
// Older webkit/blink browsers require a prefix

// …

const myListener = audioCtx.listener;

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN