melonJS
    Preparing search index...

    Function seek

    • Get or set the playback position of a sound.

      Parameters

      • sound_name: string

        Audio clip name (case-sensitive).

      • ...args: number[]

        Optional seek position in seconds, optionally followed by the sound instance ID.

      Returns number

      The current seek position when no extra arguments are given.

      // read the current position of the background music
      let current_pos = me.audio.seek("dst-gameforest");
      // rewind the background music to the beginning
      me.audio.seek("dst-gameforest", 0);