PannerNode()

The PannerNode() constructor of the Web Audio API creates a new PannerNode object instance.

Syntax

var myPanner = new PannerNode(context, options);

Parameters

context

A BaseAudioContext representing the audio context you want the node to be associated with.

options Optional

A PannerOptions dictionary object defining the properties you want the PannerNode to have:

Return value

A new PannerNode object instance.

Exceptions

RangeError

The refDistance, maxDistance, or rolloffFactor properties have been given a value that is outside the accepted range.

InvalidStateError

The coneOuterGain property has been given a value outside the accepted range (0–1).

Example

var ctx = new AudioContext();

var options = {
  positionX : 1,
  maxDistance: 5000
}

var myPanner = new PannerNode(ctx, options);

Specifications

Specification
Web Audio API
# dom-pannernode-pannernode

Browser compatibility

BCD tables only load in the browser