@like2d/like
    Preparing search index...

    Type Alias ChannelState

    The current state of a playing channel.

    type ChannelState = {
        index: number;
        loop: boolean;
        seek: number;
        speed: number;
        volume: number;
    }
    Index

    Properties

    index: number

    Modern mode (infinite polyphony): Leave this parameter undefined and the index will simply increment forever.

    Or, force monophony by choosing a channel index. This is the more retro-style playback option. Whatever was playing before is stopped. This can, for example, be used to reduce audible clutter on often-repeated sfx by stopping the last one before the next one plays. Shoving many sfx into one channel is either a mistake, or an artful technique -- depending on your sound design skills.

    loop: boolean

    Loop a sound forever. Be sure to keep track of its channel index, otherwise you'll later rely on calling Audio.stopAll or Audio.stopWave later.

    seek: number

    seek position, aka how many seconds into the sound we are. In update, this changes live position. Or, in status this is calculated on the fly.

    speed: number

    Affects speed and pitch both, like a tape or vinyl. 0.5 = slow and low, 2.0 = high and fast.

    volume: number

    Keep in mind that volume is multiplied by global volume.