---
title: "hostTime(forBeats:error:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiosequencer/hosttime(forbeats:error:)"
---

# hostTime(forBeats:error:)

Gets the host time the sequence plays at the specified position.

## Declaration

```swift
func hostTime(forBeats inBeats: AVMusicTimeStamp, error outError: NSErrorPointer) -> UInt64
```

## Parameters

- `inBeats`: The timestamp for the beat position.
- `outError`: On exit, if an error occurs, a description of the error.

## Discussion

Discussion This call is valid when the player is in a playing state. It returns 0 with an error, otherwise, or if the starting position of the player is after the specified beat. The method uses the sequence’s tempo map to translate a beat time from the starting time and the beat of the player.

## See Also

### Managing Time Stamps

- [AVMusicTimeStamp](avfaudio/avmusictimestamp.md)
- [seconds(forBeats:)](avfaudio/avaudiosequencer/seconds(forbeats:).md)
