AudioListener Class

The position and the orientation of the listener of the spatialization of the PannerNode objects of a context (https://webaudio.github.io/web-audio-api/#AudioListener).

public sealed class AudioListener

Properties

NameDescription
ForwardXGets the x coordinate of the forward direction.
ForwardYGets the y coordinate of the forward direction.
ForwardZGets the z coordinate of the forward direction.
PositionXGets the x coordinate of the position.
PositionYGets the y coordinate of the position.
PositionZGets the z coordinate of the position.
UpXGets the x coordinate of the up direction.
UpYGets the y coordinate of the up direction.
UpZGets the z coordinate of the up direction.

Gets the x coordinate of the forward direction.

public AudioParam ForwardX { get; }

Gets the y coordinate of the forward direction.

public AudioParam ForwardY { get; }

Gets the z coordinate of the forward direction.

public AudioParam ForwardZ { get; }

Gets the x coordinate of the position.

public AudioParam PositionX { get; }

Gets the y coordinate of the position.

public AudioParam PositionY { get; }

Gets the z coordinate of the position.

public AudioParam PositionZ { get; }

Gets the x coordinate of the up direction.

public AudioParam UpX { get; }

Gets the y coordinate of the up direction.

public AudioParam UpY { get; }

Gets the z coordinate of the up direction.

public AudioParam UpZ { get; }

Methods

NameDescription
SetOrientation(float, float, float, float, float, float)Sets the forward and up directions.
SetPosition(float, float, float)Sets the position (the values of AudioListener.PositionX, AudioListener.PositionY and AudioListener.PositionZ).

SetOrientation(float, float, float, float, float, float)

AudioListener.cs

Sets the forward and up directions.

public void SetOrientation(float x, float y, float z, float xUp, float yUp, float zUp)

SetPosition(float, float, float)

AudioListener.cs