setPosition method

void setPosition(
  1. num x,
  2. num y,
  3. num z
)

Note: The suggested replacement for this deprecated method is to instead set the positionX, positionY, and positionZ attributes directly.

The setPosition() method of the PannerNode Interface defines the position of the audio source relative to the listener (represented by an AudioListener object stored in the BaseAudioContext.listener attribute.) The three parameters x, y and z are unitless and describe the source's position in 3D space using the right-hand Cartesian coordinate system.

The setPosition() method's default value of the position is (0, 0, 0).

Implementation

external void setPosition(
  num x,
  num y,
  num z,
);