melonJS
    Preparing search index...

    Interface PannerAttributes

    Spatial-audio cone + distance attributes passed to audio.panner. Mirrors the WebAudio PannerNode configuration so positional sound effects can be set up declaratively (see MDN — creating a panner node for an end-to-end conceptual overview).

    interface PannerAttributes {
        coneInnerAngle?: number;
        coneOuterAngle?: number;
        coneOuterGain?: number;
        distanceModel?: DistanceModelType;
        maxDistance?: number;
        panningModel?: "HRTF" | "equalpower";
        refDistance?: number;
        rolloffFactor?: number;
    }
    Index

    Properties

    coneInnerAngle?: number

    Inner cone angle in degrees within which there is no volume reduction. Defaults to 360 (omnidirectional).

    coneOuterAngle?: number

    Outer cone angle in degrees outside which the volume is reduced to coneOuterGain. Defaults to 360.

    coneOuterGain?: number

    Linear volume multiplier (0..1) applied outside coneOuterAngle. Defaults to 0 (silent outside the cone).

    distanceModel?: DistanceModelType

    Distance-attenuation algorithm — "inverse" (default), "linear", or "exponential". Matches the WebAudio PannerNode.distanceModel union.

    maxDistance?: number

    Distance at which volume reduction stops (used by the "linear" model; clamps the falloff curve for the other one). Defaults to 10000.

    panningModel?: "HRTF" | "equalpower"

    Spatialization algorithm — "equalpower" (cheap, stereo-only) or "HRTF" (head-related, full 3D). Defaults to "HRTF".

    refDistance?: number

    Reference distance for the falloff curve — volume is 1 at this distance from the listener. Defaults to 1.

    rolloffFactor?: number

    Steepness of the falloff curve for the "inverse" model. Defaults to 1.