mwg API
    Preparing search index...

    Function loopRegionFromFile

    • The loop region a track's own file declares, as the default when the game gives none: the region from loopStartSeconds to the end (or to loopEndSeconds when the file has one), null when the file declares no loop or the declaration falls outside the track. Retro formats such as MWA carry their loop point this way, so a game need not repeat it.

      Parameters

      • file: {
            durationSeconds: number;
            loopEndSeconds?: number | null;
            loopStartSeconds?: number | null;
        }

      Returns LoopRegion | null

      import { loopRegionFromFile } from '@datamoc/mwg/audio';

      console.log(loopRegionFromFile({ loopStartSeconds: 8, durationSeconds: 60 })); // { start: 8, end: 60 }