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

# fade(to:duration:)

Transitions the gain to the given value over a time interval using a
linear curve for all audio resources in the group.

```
@MainActor @preconcurrency func fade(to newValue: Audio.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)