The PannerNode()
constructor of the Web Audio API creates a new PannerNode
object instance.
var myPanner = new PannerNode(context, options);
Inherits parameters from the AudioNodeOptions
dictionary.
BaseAudioContext
representing the audio context you want the node to be associated with.PannerOptions
dictionary object defining the properties you want the PannerNode
to have (It also inherits the options defined in the AudioNodeOptions dictionary.): panningModel
: The PannerNode.panningModel
you want the PannerNode
to have (the default is equalpower
.)distanceModel
: The PannerNode.distanceModel
you want the PannerNode
to have (the default is inverse
.)positionX
: The PannerNode.positionX
you want the PannerNode
to have (the default is 0
.)positionY
: The PannerNode.positionY
you want the PannerNode
to have (the default is 0
.)positionZ
: The PannerNode.positionZ
you want the PannerNode
to have (the default is 0
.)orientationX
: The PannerNode.orientationX
you want the PannerNode
to have (the default is 1
.)orientationY
: The PannerNode.orientationY
you want the PannerNode
to have (the default is 0
.)orientationZ
: The PannerNode.orientationZ
you want the PannerNode
to have (the default is 0
.)refDistance
: The PannerNode.refDistance
you want the PannerNode
to have. The default is 1
, and negative values are not allowed.maxDistance
: The PannerNode.maxDistance
you want the PannerNode
to have. The default is 10000
, and non-positive values are not allowed.rollOffFactor
: The PannerNode.rollOffFactor
you want the PannerNode
to have. The default is 1
, and negative values are not allowed.coneInnerAngle
: The PannerNode.coneInnerAngle
you want the PannerNode
to have (the default is 360
.)coneOuterAngle
: The PannerNode.coneOuterAngle
you want the PannerNode
to have (the default is 360
.)coneOuterGain
: The PannerNode.coneOuterGain
you want the PannerNode
to have. The default is 0
, and its value can be in the range 0–1.A new PannerNode
object instance.
RangeError
refDistance
, maxDistance
, or rolloffFactor
properties have been given a value that is outside the accepted range.InvalidStateError
coneOuterGain
property has been given a value outside the accepted range (0–1).var ctx = new AudioContext(); var options = { positionX : 1, maxDistance: 5000 } var myPanner = new PannerNode(ctx, options);
Specification | Status | Comment |
---|---|---|
Web Audio API The definition of 'PannerNode()' in that specification. | Working Draft |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 55
|
? | 53 | No | 42 | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 55
|
55
|
? | 53 | 42 | ? | 6.0 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/PannerNode