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

# setRate(_:time:)

Sets the renderer’s time and rate.

## Declaration

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

## Parameters

- `rate`: The new timebase rate. This value must be greater than or equal to 0.0.
- `time`: The 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.

## Discussion

Discussion This method first sets the new time and then the new rendering rate. A rate value of 0.0 means that playback has stopped while a rate value of 1.0 indicates playback should be at the natural rate of the media.

## See Also

### Accessing time information

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