melonJS
    Preparing search index...

    Function rate

    • Get or set the playback rate of a sound.

      Parameters

      • sound_name: string

        Audio clip name (case-sensitive).

      • ...args: number[]

        Optional playback rate (0.5..4.0, where 1.0 is normal speed), optionally followed by the sound instance ID.

      Returns number

      The current playback rate when no extra arguments are given.

      // read the current playback rate
      let rate = me.audio.rate("dst-gameforest");
      // speed it up 2×
      me.audio.rate("dst-gameforest", 2.0);