Table of Contents

Class AudioListener

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The AudioListener interface represents the position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the Listener attribute.

[Value("AudioListener")]
public class AudioListener
Inheritance
AudioListener
Inherited Members

Remarks

Constructors

AudioListener()

public AudioListener()

Properties

ForwardX

The forwardX read-only property of the AudioListener interface is an AudioParam representing the x value of the direction vector defining the forward direction the listener is pointing in.

[Value("forwardX")]
public AudioParam ForwardX { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

ForwardY

The forwardY read-only property of the AudioListener interface is an AudioParam representing the y value of the direction vector defining the forward direction the listener is pointing in.

[Value("forwardY")]
public AudioParam ForwardY { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

ForwardZ

The forwardZ read-only property of the AudioListener interface is an AudioParam representing the z value of the direction vector defining the forward direction the listener is pointing in.

[Value("forwardZ")]
public AudioParam ForwardZ { get; }

Property Value

AudioParam

An AudioParam. Its default value is -1, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

PositionX

The positionX read-only property of the AudioListener interface is an AudioParam representing the x position of the listener in 3D cartesian space.

[Value("positionX")]
public AudioParam PositionX { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

PositionY

The positionY read-only property of the AudioListener interface is an AudioParam representing the y position of the listener in 3D cartesian space.

[Value("positionY")]
public AudioParam PositionY { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

PositionZ

The positionZ read-only property of the AudioListener interface is an AudioParam representing the z position of the listener in 3D cartesian space.

[Value("positionZ")]
public AudioParam PositionZ { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

UpX

The upX read-only property of the AudioListener interface is an AudioParam representing the x value of the direction vector defining the up direction the listener is pointing in.

[Value("upX")]
public AudioParam UpX { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

UpY

The upY read-only property of the AudioListener interface is an AudioParam representing the y value of the direction vector defining the up direction the listener is pointing in.

[Value("upY")]
public AudioParam UpY { get; }

Property Value

AudioParam

An AudioParam. Its default value is 1, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

UpZ

The upZ read-only property of the AudioListener interface is an AudioParam representing the z value of the direction vector defining the up direction the listener is pointing in.

[Value("upZ")]
public AudioParam UpZ { get; }

Property Value

AudioParam

An AudioParam. Its default value is 0, and it can range between positive and negative infinity.

Remarks

NOTE

The parameter is a-rate when used with a PannerNode whose PanningModel is set to equalpower, or k-rate otherwise.

-Using the Web Audio API

See also on MDN

Methods

SetOrientation(Number, Number, Number, Number, Number, Number)

IMPORTANT
Deprecated
The setOrientation() method of the AudioListener interface defines the orientation of the listener.
[Value("setOrientation")]
public GlobalObject.Undefined SetOrientation(Number x, Number y, Number z, Number xUp, Number yUp, Number zUp)

Parameters

x Number
y Number
z Number
xUp Number
yUp Number
zUp Number

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

It consists of two direction vectors:

The two vectors must be separated by an angle of 90° — in linear analysis terms, they must be perpendicular to each other.

-Using the Web Audio API

See also on MDN

SetPosition(Number, Number, Number)

IMPORTANT
Deprecated
The setPosition() method of the AudioListener Interface defines the position of the listener.
[Value("setPosition")]
public GlobalObject.Undefined SetPosition(Number x, Number y, Number z)

Parameters

x Number
y Number
z Number

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

The three parameters x, y and z are unitless and describe the listener's position in 3D space according to the right-hand Cartesian coordinate system. PannerNode objects use this position relative to individual audio sources for spatialization.

The default value of the position vector is (0, 0, 0).

NOTE

As this method is deprecated, use the three PositionX, PositionY, and PositionZ properties instead.

-Using the Web Audio API

See also on MDN