---
title: "scaleTimeRange(_:toDuration:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablecompositiontrack/scaletimerange(_:toduration:)"
---

# scaleTimeRange(_:toDuration:)

Changes the duration of a time range of the track.

## Declaration

```swift
func scaleTimeRange(_ timeRange: CMTimeRange, toDuration duration: CMTime)
```

## Parameters

- `timeRange`: The time range to scale.
- `duration`: A new duration value.

## See Also

### Managing time ranges

- [segments](avfoundation/avmutablecompositiontrack/segments.md)
- [insertEmptyTimeRange(_:)](avfoundation/avmutablecompositiontrack/insertemptytimerange(_:).md)
- [insertTimeRange(_:of:at:)](avfoundation/avmutablecompositiontrack/inserttimerange(_:of:at:).md)
- [insertTimeRanges(_:of:at:)](avfoundation/avmutablecompositiontrack/inserttimeranges(_:of:at:).md)
- [removeTimeRange(_:)](avfoundation/avmutablecompositiontrack/removetimerange(_:).md)
