Methods
(static) clampRate()
Ensure rate is in a range valid for Howler.js
Returns:
Type | Description |
---|---|
The clamped rate |
createHowlerSound(soundName, isMusic)
Creates a new gdjs.HowlerSound using preloaded/cached Howl instances.
Parameters:
Name | Type | Description |
---|---|---|
soundName |
The name of the file or resource to play. |
|
isMusic |
True if a music, false if a sound. |
loadAudio(soundName, isMusic)
Preloads a sound or a music in memory.
Parameters:
Name | Type | Description |
---|---|---|
soundName |
The name of the file or resource to preload. |
|
isMusic |
True if a music, false if a sound. |
setResources(resources)
Update the resources data of the game. Useful for hot-reloading, should not be used otherwise.
Parameters:
Name | Type | Description |
---|---|---|
resources |
The resources data of the game. |
unloadAll()
Unloads all audio from memory. This will clear the Howl cache. This will also stop any running music or sounds.
unloadAudio(soundName, isMusic)
Unloads a sound or a music from memory. This will stop any sound/music using it.
Parameters:
Name | Type | Description |
---|---|---|
soundName |
The name of the file or resource to unload. |
|
isMusic |
True if a music, false if a sound. |