---
title: distanceAttenuation
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/spatialaudiocomponent/distanceattenuation
---

# distanceAttenuation

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

## Declaration

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

## Discussion

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