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

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

Implements

Constructors

Properties

playedSoundsLogMaxSize: number = 500

Methods

  • Creates a new gdjs.HowlerSound using preloaded/cached Howl instances.

    Parameters

    • soundName: string

      The name of the file or resource to play.

    • isMusic: boolean

      True if a music, false if a sound.

    • volume: number

      Between 0 and 1.

    • loop: boolean

      True if it should be played looping.

    • rate: number

      speed at which it is played.

    Returns HowlerSound

  • The sounds and musics played since the log was enabled (capped), oldest first. Empty when the log is not enabled.

    Returns {
        isMusic: boolean;
        soundName: string;
    }[]

  • Enable (clearing any previous entries) or disable the recording of the played sounds and musics, read with getPlayedSoundsLog. Used by gameplay tests to check that a sound was played.

    Parameters

    • enable: boolean

    Returns void

  • Unloads a sound or a music from memory. This will stop any sound/music using it.

    Parameters

    • soundName: string

      The name of the file or resource to unload.

    • isMusic: boolean

      True if a music, false if a sound.

    Returns void