melonJS
    Preparing search index...

    Function playing

    • Check whether an audio clip is currently playing.

      With no id, reports whether any instance of the clip is playing; with one, only that instance.

      Parameters

      • sound_name: string

        Audio clip name (case-sensitive).

      • Optionalid: number

        Sound instance ID. Omit to ask about the whole group.

      Returns boolean

      true when playing.

      if (!me.audio.playing("theme")) {
      me.audio.play("theme", true);
      }