This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The PannerNode interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. This AudioNode uses right-hand Cartesian coordinates to describe the source's position as a vector and its orientation as a 3D directional cone.
A PannerNode always has exactly one input and one output: the input can be mono or stereo but the output is always stereo (2 channels); you can't have panning effects without at least two audio channels!
| Number of inputs | 1 |
|---|---|
| Number of outputs | 1 |
| Channel count mode | "clamped-max" |
| Channel count | 2 |
| Channel interpretation | "speakers" |
PannerNode()Creates a new PannerNode object instance.
Inherits properties from its parent, AudioNode.
Note: The orientation and position value are set and retrieved using different syntaxes, since they're stored as AudioParam values. Retrieval is done by accessing, for example, PannerNode.positionX. While setting the same property is done with PannerNode.positionX.value. This is why these values are not marked read only, which is how they appear in the WebIDL.
PannerNode.coneInnerAngleA double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction.
PannerNode.coneOuterAngleA double value describing the angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the coneOuterGain property.
PannerNode.coneOuterGainA double value describing the amount of volume reduction outside the cone defined by the coneOuterAngle attribute. Its default value is 0, meaning that no sound can be heard.
PannerNode.distanceModelAn enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the listener. Possible values are "linear", "inverse" and "exponential". The default value is "inverse".
PannerNode.maxDistanceA double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further.
PannerNode.orientationXRepresents the horizontal position of the audio source's vector in a right-hand Cartesian coordinate system. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 1.
PannerNode.orientationYRepresents the vertical position of the audio source's vector in a right-hand Cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0.
PannerNode.orientationZRepresents the longitudinal (back and forth) position of the audio source's vector in a right-hand Cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0.
PannerNode.panningModelAn enumerated value determining which spatialization algorithm to use to position the audio in 3D space.
PannerNode.positionXRepresents the horizontal position of the audio in a right-hand Cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0.
PannerNode.positionYRepresents the vertical position of the audio in a right-hand Cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0.
PannerNode.positionZRepresents the longitudinal (back and forth) position of the audio in a right-hand Cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0.
PannerNode.refDistanceA double value representing the reference distance for reducing volume as the audio source moves further from the listener. For distances greater than this the volume will be reduced based on rolloffFactor and distanceModel.
PannerNode.rolloffFactorA double value describing how quickly the volume is reduced as the source moves away from the listener. This value is used by all distance models.
Inherits methods from its parent, AudioNode.
PannerNode.setPosition() Deprecated
Defines the position of the audio source relative to the listener (represented by an AudioListener object stored in the BaseAudioContext.listener attribute.)
PannerNode.setOrientation() Deprecated
Defines the direction the audio source is playing in.
See BaseAudioContext.createPanner() for example code.
| Specification |
|---|
| Web Audio API> # PannerNode> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
PannerNode |
55 | 79 | 53 | 42 | 14.1 | 55 | 53 | 42 | 14.5 | 6.0 | 55 | 14.5 |
PannerNode |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
coneInnerAngle |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
coneOuterAngle |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
coneOuterGain |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
distanceModel |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
maxDistance |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
orientationX |
52 | 79 | 50 | 39 | 14.1 | 52 | 50 | 41 | 14.5 | 6.0 | 52 | 14.5 |
orientationY |
52 | 79 | 50 | 39 | 14.1 | 52 | 50 | 41 | 14.5 | 6.0 | 52 | 14.5 |
orientationZ |
52 | 79 | 50 | 39 | 14.1 | 52 | 50 | 41 | 14.5 | 6.0 | 52 | 14.5 |
panningModel |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
positionX |
52 | 79 | 50 | 39 | 14.1 | 52 | 50 | 41 | 14.5 | 6.0 | 52 | 14.5 |
positionY |
52 | 79 | 50 | 39 | 14.1 | 52 | 50 | 41 | 14.5 | 6.0 | 52 | 14.5 |
positionZ |
52 | 79 | 50 | 39 | 14.1 | 52 | 50 | 41 | 14.5 | 6.0 | 52 | 14.5 |
refDistance |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
rolloffFactor |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
setOrientation |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
setPosition |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4.3 | 6 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PannerNode