Class: AudioAsset

AudioAsset

FM.AudioAsset

new AudioAsset(pName, pPath)

An audio asset represents an Audio object that is usable in the FM.js engine.
Parameters:
Name Type Description
pName string Name of the asset.
pPath string Path of the asset.
Author:
  • Simon Chauvin
Source:

Methods

getAudio() → {Audio}

Get the HTML5 Audio object.
Source:
Returns:
The HTML5 object.
Type
Audio

getName() → {string}

Get the name of the asset.
Source:
Returns:
The name of the asset.
Type
string

getPath() → {string}

Get the path to the audio file.
Source:
Returns:
The path to the asset.
Type
string

isLoaded() → {boolean}

Check if this audio file has been loaded.
Source:
Returns:
Whether the asset is loaded or not.
Type
boolean

isSupported() → {boolean}

Check if the audio format is supported by the browser.
Source:
Returns:
Whether the file type is supported by the browser.
Type
boolean

load(pCallbackFunction)

Load the audio file.
Parameters:
Name Type Description
pCallbackFunction function The function that will be called when the asset is loaded.
Source: