<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/SpatialAudioComponent/distanceAttenuation",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation21SpatialAudioComponentV19distanceAttenuationAA0D0O08DistanceG0Ovp"
  },
  "title" : "distanceAttenuation"
}
-->

# distanceAttenuation

A value that specifies the way that the sound level decreases as the distance between the listener
and the sound source increases.

```
var distanceAttenuation: Audio.DistanceAttenuation { get set }
```

## Discussion> Note: You can’t update the `distanceAttenuation` property dynamically. Set it before you prepare or play an
> audio resource on an entity.

---

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)