---
title: "setRate(_:time:atHostTime:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avsamplebufferrendersynchronizer/setrate(_:time:athosttime:)"
---

# setRate(_:time:atHostTime:)

Sets the playback rate and the relationship between the current time and host time.

## Declaration

```swift
func setRate(_ rate: Float, time: CMTime, atHostTime hostTime: CMTime)
```

## Parameters

- `rate`: A new timebase rate. This value must be greater than or equal to 0.0.
- `time`: A new timebase time. This value must be greater than or equal to doc://com.apple.documentation/documentation/CoreMedia/CMTime/zero, or doc://com.apple.documentation/documentation/CoreMedia/CMTime/invalid.
- `hostTime`: A new host time. This value must be greater than or equal to doc://com.apple.documentation/documentation/CoreMedia/CMTime/zero, or doc://com.apple.documentation/documentation/CoreMedia/CMTime/invalid.

## See Also

### Accessing time information

- [currentTime()](avfoundation/avsamplebufferrendersynchronizer/currenttime().md)
- [timebase](avfoundation/avsamplebufferrendersynchronizer/timebase.md)
- [rate](avfoundation/avsamplebufferrendersynchronizer/rate.md)
- [setRate(_:time:)](avfoundation/avsamplebufferrendersynchronizer/setrate(_:time:).md)
- [rateDidChangeNotification](avfoundation/avsamplebufferrendersynchronizer/ratedidchangenotification.md)
- [delaysRateChangeUntilHasSufficientMediaData](avfoundation/avsamplebufferrendersynchronizer/delaysratechangeuntilhassufficientmediadata.md)
