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.
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
Methods
CanPlay(IFeedbackEffect)
Declaration
public bool CanPlay(IFeedbackEffect effect)
Parameters
Returns
Play(FeedbackTarget, IFeedbackEffect)
Declaration
public void Play(FeedbackTarget target, IFeedbackEffect effect)
Parameters
Stop(FeedbackTarget)
Declaration
public void Stop(FeedbackTarget target)
Parameters
StopAll()
Declaration
Implements