---
title: "init(sampleTime:atRate:)"
framework: avfaudio
role: symbol
role_heading: Initializer
path: "avfaudio/avaudiotime/init(sampletime:atrate:)"
---

# init(sampleTime:atRate:)

Creates an audio time object with the specified timestamp and sample rate.

## Declaration

```swift
init(sampleTime: AVAudioFramePosition, atRate sampleRate: Double)
```

## Parameters

- `sampleTime`: The sample time.
- `sampleRate`: The sample rate.

## Return Value

Return Value A new AVAudioTime instance.

## See Also

### Creating an Audio Time Instance

- [init(audioTimeStamp:sampleRate:)](avfaudio/avaudiotime/init(audiotimestamp:samplerate:).md)
- [init(hostTime:)](avfaudio/avaudiotime/init(hosttime:).md)
- [init(hostTime:sampleTime:atRate:)](avfaudio/avaudiotime/init(hosttime:sampletime:atrate:).md)
- [extrapolateTime(fromAnchor:)](avfaudio/avaudiotime/extrapolatetime(fromanchor:).md)
