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 DOMException

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

InvalidStateError DOMException

Thrown if 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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
PannerNode
55
Before Chrome 59, the default values were not supported.
79
53
No
42
14.1
55
Before version 59, the default values were not supported.
55
Before Chrome 59, the default values were not supported.
53
42
14.5
6.0
Before Samsung Internet 7.0, the default values were not supported.

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/PannerNode