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
Properties
Paused
Indicates that the audio playback is currently paused.
public bool Paused { get; }
Property Value
Playing
Indicates that the audio is currently playing.
public bool Playing { get; }
Property Value
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
Pause()
Pauses any playback. Sets Paused flag to true. Doesn't modify Playing flag.
public Task Pause()
Returns
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
Resume()
Resumes any paused playback. Sets Paused flag to false. Doesn't modify Playing flag.
public Task Resume()
Returns
SetVolume(byte)
Sets the playing volume as percent
public Task SetVolume(byte percent)
Parameters
percent
byte
Returns
Stop()
Stops any current playback and clears the buffer. Sets Playing and Paused flags to false.
public Task Stop()
Returns
PlaybackFinished
Internally, sets Playing flag to false. Additional handlers can be attached to it to handle any custom logic.
public event EventHandler PlaybackFinished