logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AudioChannel

    Feedback channel that plays a sound from an AudioEffect by routing it to the audio player system. Target-agnostic (audio is global, not per-pad). The service dispatches audio effects un-gated, so this plays even when controller vibration is disabled. Fire-and-forget: short SFX, so Stop(FeedbackTarget)/StopAll() are intentional no-ops — they must NOT stop the whole audio bus when the feedback system halts on pause/focus-loss/vibration-disable.

    Inheritance
    object
    AudioChannel
    Implements
    IFeedbackChannel
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Feedback.Infrastructure.Channels
    Assembly: Serenity.UnityFeedback.Infrastructure.dll
    Syntax
    public class AudioChannel : IFeedbackChannel

    Constructors

    AudioChannel(Func<AudioPlayerType, IAudioPlayerService>, ILogService)

    Initializes a new AudioChannel.

    Declaration
    public AudioChannel(Func<AudioPlayerType, IAudioPlayerService> serviceResolver, ILogService log)
    Parameters
    Type Name Description
    Func<AudioPlayerType, IAudioPlayerService> serviceResolver

    Resolves the audio player service for a given type. May throw when no service of that type is registered; the channel resolves defensively.

    ILogService log

    Log service for diagnostic messages.

    Properties

    ChannelId

    Declaration
    public string ChannelId { get; }
    Property Value
    Type Description
    string

    Methods

    CanPlay(IFeedbackEffect)

    Declaration
    public bool CanPlay(IFeedbackEffect effect)
    Parameters
    Type Name Description
    IFeedbackEffect effect
    Returns
    Type Description
    bool

    Play(FeedbackTarget, IFeedbackEffect)

    Declaration
    public void Play(FeedbackTarget target, IFeedbackEffect effect)
    Parameters
    Type Name Description
    FeedbackTarget target
    IFeedbackEffect effect

    Stop(FeedbackTarget)

    Declaration
    public void Stop(FeedbackTarget target)
    Parameters
    Type Name Description
    FeedbackTarget target

    StopAll()

    Declaration
    public void StopAll()

    Implements

    IFeedbackChannel
    In this article
    © 2026 Serenity. All Rights Reserved