Class

AudioFx

AudioFx(eagerLoad)

Audio Game FX Handler.
Constructor

# new AudioFx(eagerLoad)

Create a new Audio FX handler.
Parameters:
Name Type Default Description
eagerLoad boolean true Whether or not to eager-load audio objects

View Source browser/lib/Audio/AudioFX.js, line 11

Classes

AudioFx

Methods

# load(keys) → {void}

Load audio FX objects.
Parameters:
Name Type Description
keys array the audio to load e.g. "soundtrack", "weapons", "snippets"

View Source browser/lib/Audio/AudioFX.js, line 56

void

# snippet(params) → {void}

Handle audio FX snippet.
Parameters:
Name Type Description
params Object
name string | null The name of the audio FX snippet to play
random boolean If name is null and this is set to true, plays a random snippet

View Source browser/lib/Audio/AudioFX.js, line 186

void

# soundtrack() → {void}

Handle the game soundtrack.

View Source browser/lib/Audio/AudioFX.js, line 216

void

# stop(key) → {void}

Stop the selected audio FX.
Parameters:
Name Type Description
key string the audio key e.g. "weapon", "snippet"

View Source browser/lib/Audio/AudioFX.js, line 97

void

# async volume(key, level) → {void}

Set the volume for the selected audio object.
Parameters:
Name Type Description
key string the audio key e.g. "soundtrack", "weapon", "snippet"
level number the volume level

View Source browser/lib/Audio/AudioFX.js, line 113

void

# weapon(params, action, playbackRate) → {void}

Handle weapon audio FX.
Parameters:
Name Type Description
params Object
weaponIndex number | null The selected weapon index
equippedWeapon string | null The selected weapon object if no index is passed
action string the weapon audio action to play e.g. "fire" or "reload"
playbackRate number the weapon audio playback rate

View Source browser/lib/Audio/AudioFX.js, line 147

void