---
title: gain
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/audioplaybackcontroller/gain
---

# gain

The individual gain in decibels of the audio playback controller output.

## Declaration

```swift
@MainActor @preconcurrency var gain: AudioPlaybackController.Decibel { get set }
```

## Discussion

Discussion The gain must be zero or negative, where zero is nominal loudness and negative infinity is silent. If the gain is positive, it will be reset to zero. Use the fade(to:duration:) method to change the gain gradually and create smooth transitions.

## See Also

### Setting the volume

- [fade(to:duration:)](realitykit/audioplaybackcontroller/fade(to:duration:).md)
