<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PHASE",
  "identifier" : "/documentation/PHASE/PHASESpatialMixerDefinition/distanceModelParameters",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "PHASE"
    ],
    "preciseIdentifier" : "c:objc(cs)PHASESpatialMixerDefinition(py)distanceModelParameters"
  },
  "title" : "distanceModelParameters"
}
-->

# distanceModelParameters

An effect that changes sound as it carries over a distance.

```
var distanceModelParameters: PHASEDistanceModelParameters? { get set }
```

## Discussion

Similar to a Doppler effect, this property changes how an audio source sounds as its distance between the listener increases or decreases in 3D space. The available options are:

- [`PHASEGeometricSpreadingDistanceModelParameters`](/documentation/PHASE/PHASEGeometricSpreadingDistanceModelParameters): Create a realistic effect by dissipating certain frequency ranges of the audio spectrum differently with distance.
- [`PHASEEnvelopeDistanceModelParameters`](/documentation/PHASE/PHASEEnvelopeDistanceModelParameters): Take full control of the sound’s volume by graphing its loudness using points and curves over the distance.

### Programmatically Check Sound Dissipation

After setting a value for this property, you can move a looping sound source to tweak the effect to your app’s particular requirements. The following code programmaticaly moves a looping source away from the listener along the z-axis:

```swift
spatialSamplerNode.playbackType = PHASEPlaybackType.looping
// ... 
var sourceTransform: PHASETransform3D = origin
sourceTransform.columns.3.z -= 6.0
while (true) {
    var posToSet: PHASETransform3D = source.transform
    posToSet.columns.3.z -= 0.05
    if (posToSet.columns.3.z < -20.0)
    {
        posToSet.columns.3.z = -6.0;
    }
    source.transform = posToSet
    usleep(20000) // 20 ms
    print("z =", source.transform.columns.3.z);
}     
```

```swift

```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)