BaseAudioContext: listener property

The listener property of the BaseAudioContext interface returns an AudioListener object that can then be used for implementing 3D audio spatialization.

Value

An AudioListener object.

Examples

Note: for a full Web Audio spatialization example, see our panner-node demo.

js

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

// …

const myListener = audioCtx.listener;

Specifications

Specification
Web Audio API
# dom-baseaudiocontext-listener

Browser compatibility

BCD tables only load in the browser

See also