Class AudioListener
Represents a 3D audio listener. Used when simulating 3D Audio.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: MonoGame.Framework.dll
Syntax
public class AudioListener : object
Constructors
AudioListener()
Create an AudioListener instance.
Declaration
public AudioListener()
Properties
Forward
Gets or sets the listener's forward vector.
Declaration
public Vector3 Forward { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
Defaults to Vector3.Forward. (new Vector3(0, 0, -1))
Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.
The Forward and Up vectors must be orthonormal.
Position
Gets or sets the listener's position.
Declaration
public Vector3 Position { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
Defaults to Vector3.Zero.
Up
Gets or sets the listener's up vector..
Declaration
public Vector3 Up { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
Defaults to Vector3.Up (New Vector3(0, -1, 0)).
Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.
The values of the Forward and Up vectors must be orthonormal.
Velocity
Gets or sets the listener's velocity vector.
Declaration
public Vector3 Velocity { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
Defaults to Vector3.Zero.
Scaled by DopplerScale to calculate the Doppler effect value applied to a Cue.
This value is only used to calculate Doppler values.