mwg API
    Preparing search index...

    Interface AudioFalloff

    How far away a source can be heard from, and how fast it fades.

    refDistance is full volume, maxDistance is silence, and rolloff shapes the drop between them: 1 is inverse-linear, 2 inverse-square. These are the names the Web Audio PannerNode uses for the same three numbers, so a game that later moves to a real panner does not have to re-author them.

    interface AudioFalloff {
        maxDistance?: number;
        refDistance?: number;
        rolloff?: number;
    }

    Hierarchy (View Summary)

    Index
    maxDistance?: number

    distance at which the source is silent; defaults to Infinity

    refDistance?: number

    distance at which the source is at full volume; defaults to 1

    rolloff?: number

    exponent of the inverse-distance drop; defaults to 1