AUKit
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
aukit::Player Class Reference

An asynchronous player created by aukit.player. More...

Public Member Functions

number livePosition ()
 Returns the estimated current position of audio playback.
 
 pause ()
 Pauses the player if it's playing.
 
 play ()
 Plays the audio if it's paused.
 
 seek (number pos)
 Seeks the current audio playback position. If the requested position isn't loaded yet, the player will hang until the audio is loaded. (If the position is out of bounds, the player will not continue.)
 
❴ playAudio→ fun (samples→ number❲❳‚ volume?→ number) ❵❲❳ speakers
 The speakers the audio is playing on.
 
 stop ()
 Stops the audio playback. This kills all tasks and invalidates the player.
 

Public Attributes

boolean invalidate
 Internal flag to invalidate current chunk.
 
boolean isPaused
 Whether the player is paused.
 
❴ pos→ number‚ time→ number ❵ lastPlayback
 Internal playback positions for pausing.
 
Task loaderTask
 The task that is loading the audio.
 
Task playerTask
 The task that is playing the audio.
 
number position
 The current position of the audio, in seconds.
 
number volume
 The volume of the audio.
 

Detailed Description

An asynchronous player created by aukit.player.

Member Function Documentation

◆ livePosition()

number aukit::Player::livePosition ( )

Returns the estimated current position of audio playback.

Returns
(number) The position of the audio‚ in seconds

◆ seek()

aukit::Player::seek ( number pos)

Seeks the current audio playback position. If the requested position isn't loaded yet, the player will hang until the audio is loaded. (If the position is out of bounds, the player will not continue.)

Parameters
pos(number) The position to seek to, in seconds

The documentation for this class was generated from the following file: