Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    AudioListener Class

    Namespace: Stride.Audio
    Assembly: Stride.Audio.dll

    Represents a 3D audio listener in the audio scene. This object, used in combination with an AudioEmitter, can simulate 3D audio localization effects for a sound implemention the IPositionableSound interface. For more details take a look at the Apply3D(AudioEmitter) function.

    System.Object → AudioListener
    Derived from AudioListener:

    public class AudioListener : IDisposable
    Name Description
    Constructors
    AudioListener()

    Initializes a new instance of the AudioListener class.

    AudioListener(AudioEngine)
    Fields
    Position

    The position of the listener in the 3D world.

    Velocity

    The velocity of the listener in the 3D world.

    Properties
    Forward

    Gets or sets the forward orientation vector for this listener. This vector represents the orientation the listener is looking at.

    Up

    Gets or sets the Up orientation vector for this listener. This vector up of the world for the listener.

    Methods
    Dispose()

    Disposes the Listener

    | Improve this Doc View Source

    Constructors


    AudioListener()

    Initializes a new instance of the AudioListener class.

    public AudioListener()

    AudioListener(AudioEngine)

    public AudioListener(AudioEngine engine)
    Parameters
    Type Name Description
    AudioEngine engine
    | Improve this Doc View Source

    Fields


    Position

    The position of the listener in the 3D world.

    public Vector3 Position
    Field Value
    Type Description
    Vector3

    Velocity

    The velocity of the listener in the 3D world.

    public Vector3 Velocity
    Field Value
    Type Description
    Vector3
    Remarks

    This is only used to calculate the doppler effect on the sound effect

    | Improve this Doc View Source

    Properties


    Forward

    Gets or sets the forward orientation vector for this listener. This vector represents the orientation the listener is looking at.

    public Vector3 Forward { get; set; }
    Property Value
    Type Description
    Vector3
    Remarks

    By default, this value is (0,0,1).

    The value provided will be normalized if it is not already.

    The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these vectors are not orthonormal.

    Doppler and Matrix values between an and an AudioListener are effected by the listener orientation.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The value provided to the set accessor is (0,0,0) or Up.


    Up

    Gets or sets the Up orientation vector for this listener. This vector up of the world for the listener.

    public Vector3 Up { get; set; }
    Property Value
    Type Description
    Vector3
    Remarks

    By default, this value is (0,1,0).

    The value provided will be normalized if it is not already.

    The values of the Forward and Up vectors must be orthonormal (at right angles to one another). Behavior is undefined if these vectors are not orthonormal.

    Doppler and Matrix values between an and an AudioListener are effected by the listener orientation.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The value provided to the set accessor is (0,0,0).

    | Improve this Doc View Source

    Methods


    Dispose()

    Disposes the Listener

    public void Dispose()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)

    See Also

    Apply3D(AudioEmitter)
    AudioEmitter
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation