logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IAudioPriorityCandidateSelector

    Selects which currently playing audio slot should be reassigned to make room for a newly requested sound when the pool is full, according to an AudioPriorityPolicy.

    Namespace: Serenity.AudioPlayer.Domain.Interfaces
    Assembly: Serenity.AudioPlayer.Domain.dll
    Syntax
    public interface IAudioPriorityCandidateSelector

    Methods

    SelectReplacement(IReadOnlyList<AudioPlaybackCandidate>, int, AudioPriorityPolicy)

    Chooses the least important replaceable candidate that satisfies the given policy.

    Declaration
    int SelectReplacement(IReadOnlyList<AudioPlaybackCandidate> activeCandidates, int requestedPriority, AudioPriorityPolicy policy)
    Parameters
    Type Name Description
    IReadOnlyList<AudioPlaybackCandidate> activeCandidates

    Snapshots of the currently playing slots.

    int requestedPriority

    Serenity priority of the sound being requested (higher = more important).

    AudioPriorityPolicy policy

    Policy controlling which candidates are eligible.

    Returns
    Type Description
    int

    The Index of the slot to reassign, or -1 when no candidate is eligible (the new sound should not play).

    In this article
    © 2026 Serenity. All Rights Reserved