PannerNode
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.
Instance Members
panningModel: PanningModelType
An enumerated value determining which spatialisation algorithm to use to position the audio in 3D space.
positionX: 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.
positionY: 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.
positionZ: 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.
orientationX: 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.
orientationY: 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.
orientationZ: 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.
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.
refDistance: Float
A double value representing the reference distance for reducing volume as the audio source moves further 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.
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.
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.
Defines the position of the audio source relative to the listener (represented by an AudioListener
object stored in the AudioContext.listener
attribute.)
Name | Type |
---|---|
x |
Float |
y |
Float |
z |
Float |
Defines the direction the audio source is playing in.
Name | Type |
---|---|
x |
Float |
y |
Float |
z |
Float |
new(context: BaseAudioContext, ?options: Null<PannerOptions>): Void
Name | Type | Default |
---|---|---|
context |
BaseAudioContext | |
options |
Null<PannerOptions> | (optional) |