<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMTimebaseSetRateAndAnchorTime(_:rate:anchorTime:immediateSourceTime:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMTimebaseSetRateAndAnchorTime"
  },
  "title" : "CMTimebaseSetRateAndAnchorTime(_:rate:anchorTime:immediateSourceTime:)"
}
-->

# CMTimebaseSetRateAndAnchorTime(_:rate:anchorTime:immediateSourceTime:)

Sets the time of a timebase at a particular host time, and changes the rate at exactly that time.

```
func CMTimebaseSetRateAndAnchorTime(_ timebase: CMTimebase, rate: Float64, anchorTime timebaseTime: CMTime, immediateSourceTime: CMTime) -> OSStatus
```

## Discussion

The system interpolates `CMTimebaseGetTime`’s results from the anchor time as though the timebase has been running at the requested rate since that time.

`CMTimebaseSetRate(timebase, rate)` is approximately equivalent to calling `CMTimebaseSetRateAndAnchorTime(timebase, rate, CMTimebaseGetTime(timebase), CMSyncGetTime(CMTimebaseGetMaster(timebase)))`, except that `CMTimebaseSetRate` doesn’t generate a `TimeJumped` notification.

---

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)