logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class MusicTrack

    Represents a music track with associated metadata and audio properties. Inherits from AudioPlayerClip to utilize audio playback features.

    Inheritance
    object
    MusicTrack
    Namespace: Serenity.MusicPlayer.Domain.Entities
    Assembly: Serenity.MusicPlayer.Domain.dll
    Syntax
    public class MusicTrack : AudioPlayerClip

    Constructors

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

    Default audio player type for music tracks.

    Declaration
    public MusicTrack(string id, string title, string artist, string filePath, AudioPlayerType clipType = 0, 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

    The unique identifier for the music track.

    string title

    The title of the music track.

    string artist

    The artist of the music track.

    string filePath

    The file path to the audio clip.

    AudioPlayerType clipType

    The type of audio player clip. Default is BackgroundMusic.

    bool loop

    Whether the audio should loop. Default is true.

    float volume

    The volume level of the audio. Default is 1.0f.

    float pitch

    The pitch level of the audio. Default is 1.0f.

    float panStereo

    The stereo pan level of the audio. Default is 0.0f.

    float spatialBlend

    The spatial blend level of the audio. Default is 0.0f.

    float reverbZoneMix

    The reverb zone mix level of the audio. Default is 1.0f.

    int rolloffMode

    The rolloff mode of the audio. Default is 1 (Logarithmic).

    float minDistance

    The minimum distance for 3D audio. Default is 1.0f.

    float maxDistance

    The maximum distance for 3D audio. Default is 500.0f.

    Remarks

    Set to BackgroundMusic by default.

    Fields

    _artist

    Declaration
    protected string _artist
    Field Value
    Type Description
    string

    Music track artist.

    _title

    Declaration
    protected string _title
    Field Value
    Type Description
    string

    Music track title.

    Methods

    GetArtist()

    Gets the artist of the music track.

    Declaration
    public string GetArtist()
    Returns
    Type Description
    string

    The artist of the music track.

    GetTitle()

    Gets the title of the music track.

    Declaration
    public string GetTitle()
    Returns
    Type Description
    string

    The title of the music track.

    In this article
    © 2026 Serenity. All Rights Reserved