Howler.js
is used for audio handling in the app, this module adds some functions to help integrate it
Methods
(static) init(_data)
Preload sounds, set them up as Howl
objects and store them in SoundManagerHowler.allAudio_ob using their ID as a key
Parameters
Name |
Type |
Description |
_data |
object
|
Name |
Type |
Description |
sound_ar |
Array.<object>
|
Info about sounds to preload |
preloadCallback |
function
|
Function to call when all the sounds have finshed loading |
|
(static) onAudioEventGeneric(howlerID, message)
Handle any miscellaneous Howler
events
Parameters
Name |
Type |
Description |
howlerID |
string
|
Howler s ID for the sound this event pertains to
|
message |
string
|
Message about the event |
(static) onAudioLoad()
A sound file has finished loading
- Broadcast an
itempreload
event, including details about how many sounds have loaded so far
- If all sounds have finished loading, call the
preloadCallback()
function that was passed into SoundManagerHowler.init()
(static) playSoundById(_id)
Find a sound by its ID and play it
Parameters
Name |
Type |
Description |
_id |
string
|
|
(static) setMuteState(_state)
Set global mute state
Parameters
Name |
Type |
Description |
_state |
boolean
|
Desired mute state (eg true will mute all sounds) |