Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PannerNode
  4. distanceModel

PannerNode: distanceModel property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

ThedistanceModel property of thePannerNode interface is an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the listener.

The possible values are:

  • linear: Alinear distance model calculating the gain induced by the distance according to:1 - rolloffFactor * (distance - refDistance) / (maxDistance - refDistance)
  • inverse: Aninverse distance model calculating the gain induced by the distance according to:refDistance / (refDistance + rolloffFactor * (Math.max(distance, refDistance) - refDistance))
  • exponential: Anexponential distance model calculating the gain induced by the distance according to:pow((Math.max(distance, refDistance) / refDistance, -rolloffFactor).

inverse is the default value ofdistanceModel.

Value

An enum — seeDistanceModelType.

Examples

SeeBaseAudioContext.createPanner() for example code.

Specifications

Specification
Web Audio API
# dom-pannernode-distancemodel

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp