ENGLISH·COURSE API
    Preparing search index...
    • Plays short audio clips one at a time, in order, and reports which one is sounding.

      Parameters

      • createAudio: CreateAudio = createBrowserAudio

        Builds a clip for a source; defaults to new Audio(src)

      Returns { playingSource: string | null; play: (sources: readonly string[]) => void }

      The source currently playing, or null, and a function that plays a sequence

      At most one clip plays: starting a sequence stops the clip in progress and cancels whatever was still queued behind it. A clip that ends — or that the browser refuses to play — leaves nothing reported as playing, so a caller never shows a playing state for sound that is not there.

      Browser-side only: it constructs Audio elements.

      const { playingSource, play } = useClipSequence();
      play(["/audio/minimal-pairs/ship.mp3", "/audio/minimal-pairs/sheep.mp3"]);