Enum libaudioverse::nodes::properties::distance_model_property::DistanceModel [] [src]

#[repr(i32)]
pub enum DistanceModel { Inverse, InverseSquare, Linear, }

used in the 3D components of this library. Indicates how sound should become quieter as objects move away from the listener. Libaudioverse computes the distance from the center of the source to the listener, then subtracts the size. In the following, distance refers to this distance. Libaudioverse also computes a second value called distancePercent; specifically, distancePercent = distance/maxDistance.

Variants

Sounds fall off as 1/(1+315*distancePercent). Just before maxDistance, the gain of the sound will be approximately -25 DB. This distance model emphasizes distance changes when sounds are close, but treats distance changes of further away sources more subtly. For full benefit of the effect of close sounds, this distance model must be used with fairly large values for maxDistance, usually around 300.

Sounds fall off as 1.0/(1+315*distancePercent*distancePercent). This is a standard inverse square law, modified such that the sound volume just before maxDistance is about -25 DB. Of the available distance models, this is the closest to an accurate simulation of large, wide-open places such as fields and stadiums.

Sound falls off as 1-distancePercent.