positionX property

AudioParam positionX

The positionX property of the PannerNode specifies the X coordinate of the audio source's position in 3D Cartesian coordinates, corresponding to the horizontal axis (left-right).

The complete vector is defined by the position of the audio source, given as (PannerNode.positionX, PannerNode.positionY, PannerNode.positionZ), and the orientation of the audio source (that is, the direction in which it's facing), given as (PannerNode.orientationX, PannerNode.orientationY, PannerNode.orientationZ).

Depending on the directionality of the sound (as specified using the attributes PannerNode.coneInnerAngle, PannerNode.coneOuterAngle, and PannerNode.coneOuterGain), the orientation of the sound may alter the perceived volume of the sound as it's being played. If the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener.

The AudioParam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its AudioParam.value property.

Implementation

AudioParam get positionX;