Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • HowlerSoundManager

Index

Methods

  • clampRate(rate: number): number
  • clearAll(): void
  • createHowlerSound(soundName: string, isMusic: boolean, volume: number, loop: boolean, rate: number): HowlerSound
  • 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

  • getGlobalVolume(): number
  • loadAudio(soundName: string, isMusic: boolean): void
  • playMusic(soundName: string, loop: boolean, volume: number, pitch: number): void
  • playMusicOnChannel(soundName: string, channel: number, loop: boolean, volume: number, pitch: number): void
  • playSound(soundName: string, loop: boolean, volume: number, pitch: number): void
  • playSoundOnChannel(soundName: string, channel: number, loop: boolean, volume: number, pitch: number): void
  • preloadAudio(onProgress: (loadedCount: number, totalCount: number) => void, onComplete: (totalCount: number) => void, resources?: ResourceData[]): void
  • Parameters

    • onProgress: (loadedCount: number, totalCount: number) => void
        • (loadedCount: number, totalCount: number): void
        • Parameters

          • loadedCount: number
          • totalCount: number

          Returns void

    • onComplete: (totalCount: number) => void
        • (totalCount: number): void
        • Parameters

          • totalCount: number

          Returns void

    • Optional resources: ResourceData[]

    Returns void

  • setGlobalVolume(volume: number): void
  • setResources(resources: ResourceData[]): void
  • unloadAll(): void
  • unloadAudio(soundName: string, isMusic: boolean): void

Constructors

Generated using TypeDoc