Class ScoreEncoder

A score encoder.

Constructors

Properties

DEFAULT_GAME_VERSION: number = 20230621

Default game version used if replay is not available. It's just the last available osu!lazer version at the moment.

Methods

  • Performs score encoding to a buffer.

    Parameters

    • Optional score: IScore

      The score for encoding.

    • Optional beatmap: IBeatmap

      The beatmap of the replay. It is required if replay contains non-legacy frames.

    Returns Promise<Uint8Array>

    The buffer with encoded score & replay data.

    Throws

    If beatmap wasn't provided for non-legacy replay.

  • Performs score & replay encoding to the specified path.

    Parameters

    • path: string

      The path for writing the .osr file.

    • Optional score: IScore

      The score for encoding.

    • Optional beatmap: IBeatmap

      The beatmap of the replay. It is required if replay contains non-legacy frames.

    Returns Promise<void>

    Throws

    If score can't be encoded

    Throws

    If beatmap wasn't provided for non-legacy replay.

    Throws

    If score can't be encoded or file can't be written.