<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAudioMixInputParameters/getVolumeRamp(for:startVolume:endVolume:timeRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioMixInputParameters(im)getVolumeRampForTime:startVolume:endVolume:timeRange:"
  },
  "title" : "getVolumeRamp(for:startVolume:endVolume:timeRange:)"
}
-->

# getVolumeRamp(for:startVolume:endVolume:timeRange:)

Retrieves the volume ramp that includes the specified time.

```
func getVolumeRamp(for time: CMTime, startVolume: UnsafeMutablePointer<Float>?, endVolume: UnsafeMutablePointer<Float>?, timeRange: UnsafeMutablePointer<CMTimeRange>?) -> Bool
```

## Parameters

`time`

If a ramp with a time range that contains the specified time has been set, information about the effective ramp for that time is supplied. Otherwise, information about the first ramp that starts after the specified time is supplied.

`startVolume`

A pointer to a float to receive the starting volume value for the volume ramp.

    This value may be     `NULL`    .

`endVolume`

A pointer to a float to receive the ending volume value for the volume ramp.

    This value may be     `NULL`    .

`timeRange`

A pointer to a <doc://com.apple.documentation/documentation/CoreMedia/CMTimeRange> to receive the time range of the volume ramp.

    This value may be     `NULL`    .

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the values were retrieved successfully, otherwise <doc://com.apple.documentation/documentation/Swift/false>. Returns <doc://com.apple.documentation/documentation/Swift/false> if `time` is beyond the duration of the last volume ramp that has been set.

## Discussion

The process of setting up volume ramps requires the configuration of an instance of [`AVMutableAudioMixInputParameters`](/documentation/AVFoundation/AVMutableAudioMixInputParameters).

---

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)