melonJS
    Preparing search index...

    Function setSpatialDefaults

    • Set the panner attributes new spatially placed sounds are given.

      Applies to sounds placed through follow or at from this point on. Sounds already playing keep what they were given, and audio.panner() still overrides per clip.

      The shipped defaults suit a world measured in pixels rather than metres. A world much larger or smaller than a few screens, or a posed 3D scene that wants "HRTF" back, says so here once.

      Parameters

      Returns void

      // a planet-scale scene, heard through a posed 3D camera
      audio.setSpatialDefaults({ refDistance: 900, panningModel: "HRTF" });