The PannerNode() constructor creates a new PannerNode object instance.
Syntax
var myPanner = new PannerNode(context, options);
Parameters
- context
- A
BaseAudioContextrepresenting the audio context you want the node to be associated with. - options Optional
- A
PannerOptionsdictionary object defining the properties you want thePannerNodeto have (It also inherits the options defined in the AudioNodeOptions dictionary.):panningModel: ThePannerNode.panningModelyou want thePannerNodeto have (the default isequalpower.)distanceModel: ThePannerNode.distanceModelyou want thePannerNodeto have (the default isinverse.)positionX: ThePannerNode.positionXyou want thePannerNodeto have (the default is0.)positionY: ThePannerNode.positionYyou want thePannerNodeto have (the default is0.)positionZ: ThePannerNode.positionZyou want thePannerNodeto have (the default is0.)orientationX: ThePannerNode.orientationXyou want thePannerNodeto have (the default is1.)orientationY: ThePannerNode.orientationYyou want thePannerNodeto have (the default is0.)orientationZ: ThePannerNode.orientationZyou want thePannerNodeto have (the default is0.)refDistance: ThePannerNode.refDistanceyou want thePannerNodeto have (the default is1.)maxDistance: ThePannerNode.maxDistanceyou want thePannerNodeto have (the default is10000.)rollOffFactor: ThePannerNode.rollOffFactoryou want thePannerNodeto have (the default is1.)coneInnerAngle: ThePannerNode.coneInnerAngleyou want thePannerNodeto have (the default is360.)coneOuterAngle: ThePannerNode.coneOuterAngleyou want thePannerNodeto have (the default is360.)coneOuterGain: ThePannerNode.coneOuterGainyou want thePannerNodeto have (the default is0.)
Example
var ctx = new AudioContext();
var options = {
positionX : 1,
maxDistance: 5000
}
var myPanner = new PannerNode(ctx, options);
Specifications
| Specification | Status | Comment |
|---|---|---|
| Web Audio API The definition of 'PannerNode' in that specification. |
Working Draft |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 55[1] | No support | No support |
29 |
No support |
| Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | 55[1] | 55[1] | No support | No support | (Yes) | No support |
[1] Before Chrome 59, the default values were not supported.