MDN self-hosted library · e01.org

BaseAudioContext: listener property

Web Audio API

Open notebook · 1 cells web-api-instance-property upstream source

Web Audio API

The listener read-only 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.

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

// …

const myListener = audioCtx.listener;

Specifications

Browser compatibility

See also