PokéRogue
    Preparing search index...

    Global manager for audio operations

    Index

    Constructors

    Properties

    currentBgm: BackgroundMusic | null = null
    volume: GameVolume

    Methods

    • Fades out the current bgm over duration ms.

      Parameters

      • duration: number = 500

        (Default 500) The amount of time the fade out should take place over, in ms

      • fixed: boolean = false

        (Default false) Whether the duration should ignore game speed

      • destroy: boolean = true

        (Default true) Whether to destroy the bgm after fading out, or just pause it

      Returns void

    • The loop point of any given battle, mystery encounter, or title track, read as seconds and milliseconds.

      Parameters

      • bgmName: string

      Returns number

    • Plays a new bgm.

      Parameters

      • OptionalbgmName: string

        (Optional) The bgm to play.
        If not specified, will first fall back to choosing the bgm based on the current battle config, then further based on the current Biome.
        Can be overridden by a currently running event.

      • fadeOutPrevious: boolean = false

        (Default false) Whether to fade out the previously playing bgm

      • loop: boolean = true

        (Default true) Whether to loop the new bgm

      • fadeDuration: number = 500

        (Default 500) How long, in ms, the fade out of the previous bgm should take

      Returns BackgroundMusic | null

      The BackgroundMusic instance for the new bgm, or null if no valid bgm could be played or the input bgm was the same as the currently playing bgm

    • Updates the set volume for the audio/bgm with the user's saved config values.

      Returns void