Class BeatmapDecoder

A beatmap decoder.

Hierarchy

  • SectionDecoder<Beatmap>
    • BeatmapDecoder

Constructors

Properties

EARLY_VERSION_TIMING_OFFSET: 24 = 24

An offset which needs to be applied to old beatmaps (v4 and lower) to correct timing changes that were applied at a game client level.

Methods

  • Performs beatmap decoding from a data buffer.

    Parameters

    • data: BufferLike

      The buffer with beatmap data.

    • Optional options: boolean | IBeatmapParsingOptions

      Beatmap parsing options. Setting this to boolean will only affect storyboard parsing. All sections that weren't specified will be enabled by default.

    Returns Beatmap

    A decoded beatmap.

    Throws

    If beatmap data can't be decoded.

  • Performs beatmap decoding from a string array.

    Parameters

    • data: string[]

      The array of split lines.

    • Optional options: boolean | IBeatmapParsingOptions

      Beatmap parsing options. Setting this to boolean will only affect storyboard parsing.

    Returns Beatmap

    A decoded beatmap.

    Throws

    If beatmap data can't be decoded.

  • Performs beatmap decoding from the specified .osu file.

    Parameters

    • path: string

      A path to the .osu file.

    • Optional options: boolean | IBeatmapParsingOptions

      Beatmap parsing options. Setting this to boolean will only affect storyboard parsing. All sections that weren't specified will be enabled by default.

    Returns Promise<Beatmap>

    A decoded beatmap.

    Throws

    If file doesn't exist or can't be decoded.

  • Performs beatmap decoding from a string.

    Parameters

    • str: string

      The string with beatmap data.

    • Optional options: boolean | IBeatmapParsingOptions

      Beatmap parsing options. Setting this to boolean will only affect storyboard parsing. All sections that weren't specified will be enabled by default.

    Returns Beatmap

    A decoded beatmap.

    Throws

    If beatmap data can't be decoded.