logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AudioPlayerClip

    Represents an audio clip with various playback settings and properties.
    Encapsulates all necessary information for managing and playing audio clips in the audio player system.

    Inheritance
    object
    AudioPlayerClip
    Implements
    IFoundationSettings
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.AudioPlayer.Domain.Entities
    Assembly: Serenity.AudioPlayer.Domain.dll
    Syntax
    public class AudioPlayerClip : IFoundationSettings

    Constructors

    AudioPlayerClip()

    Initializes a new instance of the AudioPlayerClip class.

    Declaration
    public AudioPlayerClip()

    AudioPlayerClip(IAudioPlayerClipDefinition, AudioPlayerType)

    Declaration
    public AudioPlayerClip(IAudioPlayerClipDefinition audioPlayerClipDefinition, AudioPlayerType clipType)
    Parameters
    Type Name Description
    IAudioPlayerClipDefinition audioPlayerClipDefinition
    AudioPlayerType clipType

    AudioPlayerClip(string, string, AudioPlayerType, bool, float, float, float, float, float, int, float, float)

    Initializes a new instance of the AudioPlayerClip class with specified parameters.

    Declaration
    public AudioPlayerClip(string id, string filePath, AudioPlayerType clipType = AudioPlayerType.SFX, bool loop = false, float volume = 1, float pitch = 1, float panStereo = 0, float spatialBlend = 0, float reverbZoneMix = 1, int rolloffMode = 0, float minDistance = 1, float maxDistance = 500)
    Parameters
    Type Name Description
    string id

    Unique identifier for the audio clip.

    string filePath

    File path to the audio clip.

    AudioPlayerType clipType

    Type of the audio clip (default is SFX).

    bool loop

    Indicates whether the audio clip should loop (default is false).

    float volume

    Volume level for the audio clip (default is 1.0).

    float pitch

    Pitch level for the audio clip (default is 1.0).

    float panStereo

    Pan stereo level for the audio clip (default is 0.0).

    float spatialBlend

    Spatial blend level for the audio clip (default is 0.0).

    float reverbZoneMix

    Reverb zone mix level for the audio clip (default is 1.0).

    int rolloffMode

    Rolloff mode for the audio clip (default is 0).

    float minDistance

    Minimum distance for the audio clip (default is 1.0).

    float maxDistance

    Maximum distance for the audio clip (default is 500.0).

    Fields

    DEFAULT_CLIP_TYPE

    Declaration
    protected const AudioPlayerType DEFAULT_CLIP_TYPE = SFX
    Field Value
    Type Description
    AudioPlayerType

    Default clip type for audio clips.

    DEFAULT_LOOP

    Declaration
    protected const bool DEFAULT_LOOP = false
    Field Value
    Type Description
    bool

    Default loop setting for audio clips.

    DEFAULT_MAX_DISTANCE

    Declaration
    protected const float DEFAULT_MAX_DISTANCE = 500
    Field Value
    Type Description
    float

    Default maximum distance for audio clips.

    DEFAULT_MIN_DISTANCE

    Declaration
    protected const float DEFAULT_MIN_DISTANCE = 1
    Field Value
    Type Description
    float

    Default minimum distance for audio clips.

    DEFAULT_PAN_STEREO

    Declaration
    protected const float DEFAULT_PAN_STEREO = 0
    Field Value
    Type Description
    float

    Default pan stereo level for audio clips.

    DEFAULT_PITCH

    Declaration
    protected const float DEFAULT_PITCH = 1
    Field Value
    Type Description
    float

    Default pitch level for audio clips.

    DEFAULT_REVERB_ZONE_MIX

    Declaration
    protected const float DEFAULT_REVERB_ZONE_MIX = 1
    Field Value
    Type Description
    float

    Default reverb zone mix level for audio clips.

    DEFAULT_ROLLOFF_MODE

    Declaration
    protected const int DEFAULT_ROLLOFF_MODE = 0
    Field Value
    Type Description
    int

    Default rolloff mode for audio clips.

    DEFAULT_SPATIAL_BLEND

    Declaration
    protected const float DEFAULT_SPATIAL_BLEND = 0
    Field Value
    Type Description
    float

    Default spatial blend level for audio clips.

    DEFAULT_VOLUME

    Declaration
    protected const float DEFAULT_VOLUME = 1
    Field Value
    Type Description
    float

    Default volume level for audio clips.

    _clipType

    Declaration
    protected AudioPlayerType _clipType
    Field Value
    Type Description
    AudioPlayerType

    Type of the audio clip (e.g., SFX, Music).

    _filePath

    Declaration
    protected string _filePath
    Field Value
    Type Description
    string

    File path to the audio clip.

    _guid

    Declaration
    protected string _guid
    Field Value
    Type Description
    string

    Global unique identifier for the audio clip.

    _id

    Declaration
    protected string _id
    Field Value
    Type Description
    string

    Unique identifier for the audio clip.

    _loop

    Declaration
    protected bool _loop
    Field Value
    Type Description
    bool

    Indicates whether the audio clip should loop.

    _maxDistance

    Declaration
    protected float _maxDistance
    Field Value
    Type Description
    float

    Maximum distance for the audio clip.

    _minDistance

    Declaration
    protected float _minDistance
    Field Value
    Type Description
    float

    Minimum distance for the audio clip.

    _panStereo

    Declaration
    protected float _panStereo
    Field Value
    Type Description
    float

    Pan stereo level for the audio clip.

    _pitch

    Declaration
    protected float _pitch
    Field Value
    Type Description
    float

    Pitch level for the audio clip.

    _reverbZoneMix

    Declaration
    protected float _reverbZoneMix
    Field Value
    Type Description
    float

    Reverb zone mix level for the audio clip.

    _rolloffMode

    Declaration
    protected int _rolloffMode
    Field Value
    Type Description
    int

    Rolloff mode for the audio clip.

    _spatialBlend

    Declaration
    protected float _spatialBlend
    Field Value
    Type Description
    float

    Spatial blend level for the audio clip.

    _volume

    Declaration
    protected float _volume
    Field Value
    Type Description
    float

    Volume level for the audio clip.

    Properties

    Guid

    Declaration
    public string Guid { get; set; }
    Property Value
    Type Description
    string

    Gets or sets the global unique identifier for the audio clip.

    Id

    Declaration
    public string Id { get; set; }
    Property Value
    Type Description
    string

    Gets or sets the unique identifier for the audio clip.

    Methods

    GetClipType()

    Gets the type of the audio clip.

    Declaration
    public AudioPlayerType GetClipType()
    Returns
    Type Description
    AudioPlayerType

    AudioPlayerType enum value

    GetFilePath()

    Gets the file path of the audio clip.

    Declaration
    public string GetFilePath()
    Returns
    Type Description
    string

    File path string

    GetId()

    Gets the unique identifier of the audio clip.

    Declaration
    public string GetId()
    Returns
    Type Description
    string

    Unique identifier string

    GetLoop()

    Gets whether the audio clip is set to loop.

    Declaration
    public bool GetLoop()
    Returns
    Type Description
    bool

    True if looping is enabled, false otherwise

    GetMaxDistance()

    Gets the maximum distance of the audio clip.

    Declaration
    public float GetMaxDistance()
    Returns
    Type Description
    float

    Maximum distance as a float

    GetMinDistance()

    Gets the minimum distance of the audio clip.

    Declaration
    public float GetMinDistance()
    Returns
    Type Description
    float

    Minimum distance as a float

    GetPanStereo()

    Gets the pan stereo level of the audio clip.

    Declaration
    public float GetPanStereo()
    Returns
    Type Description
    float

    Pan stereo level as a float

    GetPitch()

    Gets the pitch level of the audio clip.

    Declaration
    public float GetPitch()
    Returns
    Type Description
    float

    Pitch level as a float

    GetReverbZoneMix()

    Gets the reverb zone mix level of the audio clip.

    Declaration
    public float GetReverbZoneMix()
    Returns
    Type Description
    float

    Reverb zone mix level as a float

    GetRolloffMode()

    Gets the rolloff mode of the audio clip.

    Declaration
    public int GetRolloffMode()
    Returns
    Type Description
    int

    Rolloff mode as an integer

    GetSpatialBlend()

    Gets the spatial blend level of the audio clip.

    Declaration
    public float GetSpatialBlend()
    Returns
    Type Description
    float

    Spatial blend level as a float

    GetVolume()

    Gets the volume level of the audio clip.

    Declaration
    public float GetVolume()
    Returns
    Type Description
    float

    Volume level as a float

    SetClipType(AudioPlayerType)

    Sets the type of the audio clip.

    Declaration
    public void SetClipType(AudioPlayerType clipType)
    Parameters
    Type Name Description
    AudioPlayerType clipType

    The audio clip type to set.

    SetFilePath(string)

    Sets the file path of the audio clip.

    Declaration
    public void SetFilePath(string filePath)
    Parameters
    Type Name Description
    string filePath

    The file path to set.

    SetLoop(bool)

    Sets whether the audio clip should loop.

    Declaration
    public void SetLoop(bool loop)
    Parameters
    Type Name Description
    bool loop

    True to enable looping, false to disable.

    SetMaxDistance(float)

    Sets the maximum distance of the audio clip.

    Declaration
    public void SetMaxDistance(float maxDistance)
    Parameters
    Type Name Description
    float maxDistance

    The maximum distance to set.

    SetMinDistance(float)

    Sets the minimum distance of the audio clip.

    Declaration
    public void SetMinDistance(float minDistance)
    Parameters
    Type Name Description
    float minDistance

    The minimum distance to set.

    SetPanStereo(float)

    Sets the pan stereo level of the audio clip.

    Declaration
    public void SetPanStereo(float panStereo)
    Parameters
    Type Name Description
    float panStereo

    The pan stereo level to set.

    SetPitch(float)

    Sets the pitch level of the audio clip.

    Declaration
    public void SetPitch(float pitch)
    Parameters
    Type Name Description
    float pitch

    The pitch level to set.

    SetReverbZoneMix(float)

    Sets the reverb zone mix level of the audio clip.

    Declaration
    public void SetReverbZoneMix(float reverbZoneMix)
    Parameters
    Type Name Description
    float reverbZoneMix

    The reverb zone mix level to set.

    SetRolloffMode(int)

    Sets the rolloff mode of the audio clip.

    Declaration
    public void SetRolloffMode(int rolloffMode)
    Parameters
    Type Name Description
    int rolloffMode

    The rolloff mode to set.

    SetSpatialBlend(float)

    Sets the spatial blend level of the audio clip.

    Declaration
    public void SetSpatialBlend(float spatialBlend)
    Parameters
    Type Name Description
    float spatialBlend

    The spatial blend level to set.

    SetVolume(float)

    Sets the volume level of the audio clip.

    Declaration
    public void SetVolume(float volume)
    Parameters
    Type Name Description
    float volume

    The volume level to set.

    ToString()

    Returns a string representation of the audio clip.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    String representation of the audio clip

    Overrides
    object.ToString()

    Implements

    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved