#[repr(transparent)]pub struct AVAudioEnvironmentDistanceAttenuationModel(pub NSInteger);AVAudioEnvironmentNode only.Expand description
Types of distance attenuation models
Distance attenuation is the natural attenuation of sound when traveling from the source to the listener. The different attenuation models listed below describe the drop-off in gain as the source moves away from the listener.
AVAudioEnvironmentDistanceAttenuationModelExponential distanceGain = (distance / referenceDistance) ^ (-rolloffFactor)
AVAudioEnvironmentDistanceAttenuationModelInverse distanceGain = referenceDistance / (referenceDistance + rolloffFactor * (distance – referenceDistance))
AVAudioEnvironmentDistanceAttenuationModelLinear distanceGain = (1 – rolloffFactor * (distance – referenceDistance) / (maximumDistance – referenceDistance))
With all the distance models, if the formula can not be evaluated then the source will not be attenuated. For example, if a linear model is being used with referenceDistance equal to maximumDistance, then the gain equation will have a divide-by-zero error in it. In this case, there is no attenuation for that source.
All the values for distance are specified in meters.
See also Apple’s documentation
Tuple Fields§
§0: NSIntegerImplementations§
Trait Implementations§
Source§impl Clone for AVAudioEnvironmentDistanceAttenuationModel
impl Clone for AVAudioEnvironmentDistanceAttenuationModel
Source§fn clone(&self) -> AVAudioEnvironmentDistanceAttenuationModel
fn clone(&self) -> AVAudioEnvironmentDistanceAttenuationModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Ord for AVAudioEnvironmentDistanceAttenuationModel
impl Ord for AVAudioEnvironmentDistanceAttenuationModel
Source§fn cmp(&self, other: &AVAudioEnvironmentDistanceAttenuationModel) -> Ordering
fn cmp(&self, other: &AVAudioEnvironmentDistanceAttenuationModel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AVAudioEnvironmentDistanceAttenuationModel
impl PartialEq for AVAudioEnvironmentDistanceAttenuationModel
Source§fn eq(&self, other: &AVAudioEnvironmentDistanceAttenuationModel) -> bool
fn eq(&self, other: &AVAudioEnvironmentDistanceAttenuationModel) -> bool
self and other values to be equal, and is used by ==.