HowlerSoundManager

HowlerSoundManager

HowlerSoundManager is used to manage the sounds and musics of a RuntimeScene.

It is basically a container to associate channels to sounds and keep a list of all sounds being played.

Constructor

new HowlerSoundManager()

Source:

Methods

(static) clampRate()

Ensure rate is in a range valid for Howler.js

Returns:
Type Description

The clamped rate

Source:

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.

Source:

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.

Source:

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.

Source:

unloadAll()

Unloads all audio from memory. This will clear the Howl cache. This will also stop any running music or sounds.

Source:

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.

Source: