PannerNode: maxDistance property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.

The maxDistance property of the PannerNode interface is a double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further. This value is used only by the linear distance model.

The maxDistance property's default value is 10000.

Value

A double. The default is 10000, and non-positive values are not allowed.

Exceptions

RangeError

Thrown if the property has been given a value that is outside the accepted range.

Examples

See BaseAudioContext.createPanner() for example code.

Specifications

Specification
Web Audio API
# dom-pannernode-maxdistance

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
maxDistance

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also