melonJS
    Preparing search index...

    Function panner

    • Parameters

      • sound_name: string

        audio clip name - case sensitive

      • Optionalattributes: PannerAttributes

        the panner attributes to set

        • coneInnerAngle

          A parameter for directional audio sources, this is an angle, in degrees, inside of which there will be no volume reduction.

        • coneOuterAngle

          A parameter for directional audio sources, this is an angle, in degrees, outside of which the volume will be reduced to a constant value of coneOuterGain.

        • coneOuterGain

          A parameter for directional audio sources, this is the gain outside of the coneOuterAngle. It is a linear value in the range [0, 1].

        • distanceModel

          Determines algorithm used to reduce volume as audio moves away from listener. Can be linear, inverse or exponential. @param [attributes.maxDistance=10000] - The maximum distance between source and listener, after which the volume will not be reduced any further. @param [attributes.refDistance=1] - A reference distance for reducing volume as source moves further from the listener. This is simply a variable of the distance model and has a different effect depending on which model is used and the scale of your coordinates. Generally, volume will be equal to 1 at this distance. @param [attributes.rolloffFactor=1] - How quickly the volume reduces as source moves from listener. This is simply a variable of the distance model and can be in the range of [0, 1]withlinearand[0, ∞]withinverseandexponential. @param [attributes.panningModel="HRTF"] - Determines which spatialization algorithm is used to position audio. Can be HRTForequalpower`.

      • Optionalid: number

        the sound instance ID. If none is passed, all sounds in group will be changed.

      Returns PannerAttributes

      current panner attributes.

      me.audio.panner("cling", {
      panningModel: 'HRTF',
      refDistance: 0.8,
      rolloffFactor: 2.5,
      distanceModel: 'exponential'
      });