jetlag2d
    Preparing search index...

    Class AudioLibraryService

    AudioLibraryService provides a library of sound and music objects that can be played at any time. The only difference between sounds and music is that music objects will always loop, whereas sound objects never will.

    Index
    • get musicVolume(): number

      The volume of all music, from 0 (silent) to 1 (full). The default is 1.

      NB: Setting the volume of one playback of a sound, via ISound.volume(v, id), overrides this for that playback.

      Returns number

    • set musicVolume(volume: number): void

      The volume of all music, from 0 (silent) to 1 (full)

      Parameters

      • volume: number

      Returns void

    • get sfxVolume(): number

      The volume of all sound effects, from 0 (silent) to 1 (full). The default is 1.

      NB: Setting the volume of one playback of a sound, via ISound.volume(v, id), overrides this for that playback.

      Returns number

    • set sfxVolume(volume: number): void

      The volume of all sound effects, from 0 (silent) to 1 (full)

      Parameters

      • volume: number

      Returns void

    • Get a previously loaded Music object. It's an error to ask for music that isn't in the list of music names in the game's Config.

      Parameters

      • musicName: string

        Name of the music file to retrieve

      Returns ISound

    • Get a previously loaded Sound object. It's an error to ask for a sound that isn't in the list of sound names in the game's Config.

      Parameters

      • soundName: string

        Name of the sound file to retrieve

      Returns ISound