SystemAudio

SystemAudio

Creates audio systems.

Constructor

new SystemAudio()

Description:
  • Creates a new audio system.
Source:
Example
const system = new SystemAudio();

Members

(readonly) DELAYCONTEXTCLEARSAFE :number

Description:
  • Stores the safe delay before removing the audio context when the system terminates.
Source:
Stores the safe delay before removing the audio context when the system terminates.
Type:
  • number

Methods

hasAssetLoaded($asset) → {boolean}

Description:
  • Checks if the system has loaded the given asset.
Source:
Parameters:
Name Type Description
$asset string The asset source.
Returns:
Type
boolean

loadAudio($content) → {Promise.<AudioBuffer>}

Description:
  • Loads the audio from the given audio file content.
Source:
Parameters:
Name Type Description
$content Response The audio file content.
Returns:
Type
Promise.<AudioBuffer>

onInitiate()

Description:
  • Called when the system is being initiated.
Source:

onTerminate() → {void|Promise.<void>}

Description:
  • Called when the system is being terminated.
Source:
Returns:
Type
void | Promise.<void>

onTick($parameters)

Description:
  • Called when the system is being updated by one tick update.
Source:
Parameters:
Name Type Description
$parameters Object The given parameters.
$parameters.$stage Stage The stage on which to execute the system.
$parameters.$timetick number The tick duration (in ms).