<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AudioPlaybackController/fade(to:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation23AudioPlaybackControllerC4fade2to8durationySd_SdtF"
  },
  "title" : "fade(to:duration:)"
}
-->

# fade(to:duration:)

Transitions the gain to the given value over a time interval using a
linear curve.

```
@MainActor @preconcurrency func fade(to newValue: AudioPlaybackController.Decibel, duration: TimeInterval)
```

## Parameters

`newValue`

The target decibel level.

`duration`

How long in seconds the fade should last.

## Discussion

The target 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.

---

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)