Interface IAudioPlayerService
Service interface for audio player functionalities.
Namespace: Serenity.AudioPlayer.Application.Interfaces
Assembly: Serenity.AudioPlayer.Application.dll
Syntax
public interface IAudioPlayerService : IService, IFoundationSettings
Properties
AudioGameSettings
Declaration
IGameSettingsDefinition AudioGameSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| IGameSettingsDefinition | Gets or sets audio game settings. |
IsEnabled
Declaration
bool IsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether the audio player is enabled. |
Methods
Enable()
Enables the audio player.
Declaration
void Enable()
GetAudioPlayerType()
Declaration
AudioPlayerType GetAudioPlayerType()
Returns
| Type | Description |
|---|---|
| AudioPlayerType | Gets the type of the audio player. |
Initialize(IGameSettingsService, IAudioPlayerSettings, object, IEventDispatcherService, ILogService)
Initializes the audio player service with the provided dependencies.
Declaration
void Initialize(IGameSettingsService gameSettingsService, IAudioPlayerSettings settings, object audioSourceList, IEventDispatcherService eventDispatcherService, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameSettingsService | gameSettingsService | Service for managing game settings. |
| IAudioPlayerSettings | settings | Settings for configuring the audio player. |
| object | audioSourceList | List or pool of audio sources for playback. |
| IEventDispatcherService | eventDispatcherService | Service for dispatching events. |
| ILogService | logService | Service for logging information and errors. |
PauseAllClips()
Pauses all currently playing audio clips.
Declaration
void PauseAllClips()
PlayClip(AudioPlayerPlayClipInput)
Plays an audio clip based on the provided input data.
Declaration
AudioPlayerPlayClipOutput PlayClip(AudioPlayerPlayClipInput input)
Parameters
| Type | Name | Description |
|---|---|---|
| AudioPlayerPlayClipInput | input | Input data for playing the audio clip |
Returns
| Type | Description |
|---|---|
| AudioPlayerPlayClipOutput | Output data containing information about the played audio clip |
ResumeAllClips()
Resumes all currently paused audio clips.
Declaration
void ResumeAllClips()
StopAllClips()
Stops all currently playing audio clips.
Declaration
void StopAllClips()