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!

Documentation PannerNode by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Constructor

new(context:BaseAudioContext, ?options:Null<PannerOptions>)

Throws:

null

DOMError

Variables

coneInnerAngle:Float

Is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction.

coneOuterAngle:Float

A 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 attribute.

coneOuterGain:Float

A 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.

distanceModel:DistanceModelType

An enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the listener.

maxDistance:Float

A double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further.

read onlyorientationX:AudioParam

Represents the horizontal position of the audio source's vector in a right-hand cartesian coordinate sytem. While this AudioParam cannot be directly changed, its value can be altered using its AudioParam.value property. The default is value is 1.

read onlyorientationY:AudioParam

Represents the vertical position of the audio source's vector in a right-hand cartesian coordinate sytem. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its AudioParam.value property. The default is value is 0.

read onlyorientationZ:AudioParam

Represents the longitudinal (back and forth) position of the audio source's vector in a right-hand cartesian coordinate sytem. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its AudioParam.value property. The default is value is 0.

panningModel:PanningModelType

An enumerated value determining which spatialisation algorithm to use to position the audio in 3D space.

read onlypositionX:AudioParam

Represents the horizontal position of the audio in a right-hand cartesian coordinate sytem. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its AudioParam.value property. The default is value is 0.

read onlypositionY:AudioParam

Represents the vertical position of the audio in a right-hand cartesian coordinate sytem. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its AudioParam.value property. The default is value is 0.

read onlypositionZ:AudioParam

Represents the longitudinal (back and forth) position of the audio in a right-hand cartesian coordinate sytem. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its AudioParam.value property. The default is value is 0.

refDistance:Float

A double value representing the reference distance for reducing volume as the audio source moves further from the listener.

rolloffFactor:Float

A 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.

Methods

setOrientation(x:Float, y:Float, z:Float):Void

Defines the direction the audio source is playing in.

setPosition(x:Float, y:Float, z:Float):Void

Defines the position of the audio source relative to the listener (represented by an AudioListener object stored in the AudioContext.listener attribute.)

Inherited Variables

Defined by AudioNode

channelCount:Int

Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. Its usage and precise definition depend on the value of AudioNode.channelCountMode.

channelCountMode:ChannelCountMode

Represents an enumerated value describing the way channels must be matched between the node's inputs and outputs.

channelInterpretation:ChannelInterpretation

Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio up-mixing and down-mixing will happen.

The possible values are "speakers" or "discrete".

read onlycontext:BaseAudioContext

Returns the associated BaseAudioContext, that is the object representing the processing graph the node is participating in.

read onlynumberOfInputs:Int

Returns the number of inputs feeding the node. Source nodes are defined as nodes having a numberOfInputs property with a value of 0.

read onlynumberOfOutputs:Int

Returns the number of outputs coming out of the node. Destination nodes — like AudioDestinationNode — have a value of 0 for this attribute.

Inherited Methods

Defined by AudioNode

@:value({ output : 0 })connect(destination:AudioParam, output:Int = 0):Void

@:value({ input : 0, output : 0 })connect(destination:AudioNode, output:Int = 0, input:Int = 0):AudioNode

Allows us to connect the output of this node to be input into another node, either as audio data or as the value of an AudioParam.

Throws:

null

DOMError

disconnect(destination:AudioParam, output:Int):Void

disconnect():Void

disconnect(output:Int):Void

disconnect(destination:AudioNode):Void

disconnect(destination:AudioNode, output:Int):Void

disconnect(destination:AudioNode, output:Int, input:Int):Void

disconnect(destination:AudioParam):Void

Allows us to disconnect the current node from another one it is already connected to.

Throws:

null

DOMError

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

Register an event handler of a specific event type on the EventTarget.

Throws:

null

DOMError

dispatchEvent(event:Event):Bool

Dispatch an event to this EventTarget.

Throws:

null

DOMError

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes an event listener from the EventTarget.

Throws:

null

DOMError