Table of Contents

Class Player

Namespace
Alis.Core.Audio
Assembly
Alis.dll

The player class

public class Player : IPlayer

Inheritance

Implements

Inherited Members

Constructors

Player()

Initializes a new instance of the Alis.Core.Audio.Player class

public Player()

Exceptions

Exception

No implementation exist for the current OS

Fields

_internalPlayer

The internal player

private readonly IPlayer _internalPlayer

Field Value

IPlayer

Properties

Paused

Indicates that the audio playback is currently paused.

public bool Paused { get; }

Property Value

bool

Playing

Indicates that the audio is currently playing.

public bool Playing { get; }

Property Value

bool

Methods

CheckOs()

Checks the os

internal static IPlayer CheckOs()

Returns

IPlayer

The player

OnPlaybackFinished(object, EventArgs)

Ons the playback finished using the specified sender

internal void OnPlaybackFinished(object sender, EventArgs e)

Parameters

sender object

The sender

e EventArgs

The

Pause()

Pauses any playback. Sets Paused flag to true. Doesn't modify Playing flag.

public Task Pause()

Returns

Task

Play(string)

Will stop any current playback and will start playing the specified audio file. The fileName parameter can be an absolute path or a path relative to the directory where the library is located. Sets Playing flag to true. Sets Paused flag to false.

public Task Play(string fileName)

Parameters

fileName string

Returns

Task

Resume()

Resumes any paused playback. Sets Paused flag to false. Doesn't modify Playing flag.

public Task Resume()

Returns

Task

SetVolume(byte)

Sets the playing volume as percent

public Task SetVolume(byte percent)

Parameters

percent byte

Returns

Task

Stop()

Stops any current playback and clears the buffer. Sets Playing and Paused flags to false.

public Task Stop()

Returns

Task

PlaybackFinished

Internally, sets Playing flag to false. Additional handlers can be attached to it to handle any custom logic.

public event EventHandler PlaybackFinished

Event Type

EventHandler

See Also