logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AudioClipSpatialSettingsRules

    The defaults for a positioned play and the rules for the spatial settings an author may choose: the values allowed and the message for a value that is not. Pure and engine-free, so the inspector, the batch importer and the recipes agree on the same rules. The defaults are what a positioned play of an unauthored clip already used; the clip's own DEFAULT_* values are the 2D defaults and are a separate concern.

    Inheritance
    object
    AudioClipSpatialSettingsRules
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.AudioPlayer.Domain.Services
    Assembly: Serenity.AudioPlayer.Domain.dll
    Syntax
    public static class AudioClipSpatialSettingsRules

    Fields

    DefaultMaxDistance

    Metres beyond which a positioned one-shot no longer attenuates when the author did not choose.

    Declaration
    public const float DefaultMaxDistance = 500
    Field Value
    Type Description
    float

    DefaultMinDistance

    Metres within which a positioned one-shot is at full volume when the author did not choose.

    Declaration
    public const float DefaultMinDistance = 8
    Field Value
    Type Description
    float

    DefaultRolloffMode

    Rolloff of a positioned one-shot when the author did not choose.

    Declaration
    public const AudioRolloffMode DefaultRolloffMode = Logarithmic
    Field Value
    Type Description
    AudioRolloffMode

    DefaultSpread

    Speaker spread, in degrees, of a positioned one-shot when the author did not choose.

    Declaration
    public const float DefaultSpread = 0
    Field Value
    Type Description
    float

    MaximumSpread

    The highest spread an author may choose, in degrees.

    Declaration
    public const float MaximumSpread = 360
    Field Value
    Type Description
    float

    MinimumMinDistance

    The lowest min distance an author may choose, in metres.

    Declaration
    public const float MinimumMinDistance = 0
    Field Value
    Type Description
    float

    MinimumSpread

    The lowest spread an author may choose, in degrees.

    Declaration
    public const float MinimumSpread = 0
    Field Value
    Type Description
    float

    Properties

    AuthorableRolloffModes

    The rolloff modes an author may choose; Custom needs a curve this group cannot carry.

    Declaration
    public static IReadOnlyList<AudioRolloffMode> AuthorableRolloffModes { get; }
    Property Value
    Type Description
    IReadOnlyList<AudioRolloffMode>

    Methods

    DescribeInvalid(float, float, AudioRolloffMode, float)

    The message naming the first rule the values break, or null when they are all allowed. Not-a-number and infinite values break the rules.

    Declaration
    public static string DescribeInvalid(float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spread)
    Parameters
    Type Name Description
    float minDistance
    float maxDistance
    AudioRolloffMode rolloffMode
    float spread
    Returns
    Type Description
    string

    DescribeInvalidRolloff(AudioRolloffMode)

    The message for a rolloff a clip cannot carry, or null when it is authorable. A value that names no mode at all is reported as unknown rather than as Custom.

    Declaration
    public static string DescribeInvalidRolloff(AudioRolloffMode rolloffMode)
    Parameters
    Type Name Description
    AudioRolloffMode rolloffMode
    Returns
    Type Description
    string

    DescribeInvalidWhenCustom(IAudioPlayerClipSpatialSettingsDefinition)

    The same check for a definition: null when it does not use custom spatial settings or its group is valid.

    Declaration
    public static string DescribeInvalidWhenCustom(IAudioPlayerClipSpatialSettingsDefinition settings)
    Parameters
    Type Name Description
    IAudioPlayerClipSpatialSettingsDefinition settings
    Returns
    Type Description
    string

    DescribeInvalidWhenCustom(bool, float, float, AudioRolloffMode, float)

    Like DescribeInvalid(float, float, AudioRolloffMode, float), but a clip that does not use custom spatial settings has nothing to check, so it is always null.

    Declaration
    public static string DescribeInvalidWhenCustom(bool customSpatialSettings, float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spread)
    Parameters
    Type Name Description
    bool customSpatialSettings
    float minDistance
    float maxDistance
    AudioRolloffMode rolloffMode
    float spread
    Returns
    Type Description
    string

    IsAuthorableRolloffMode(AudioRolloffMode)

    Declaration
    public static bool IsAuthorableRolloffMode(AudioRolloffMode rolloffMode)
    Parameters
    Type Name Description
    AudioRolloffMode rolloffMode
    Returns
    Type Description
    bool

    MatchesDefaults(float, float, AudioRolloffMode, float)

    Whether the values are exactly the defaults, i.e. the author changed nothing.

    Declaration
    public static bool MatchesDefaults(float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spread)
    Parameters
    Type Name Description
    float minDistance
    float maxDistance
    AudioRolloffMode rolloffMode
    float spread
    Returns
    Type Description
    bool
    In this article
    © 2026 Serenity. All Rights Reserved