Instance Method

beats(forHostTime:error:)

Returns the beat that will be (or was) played at the specified host time.

Declaration

func beats(forHostTime inHostTime: UInt64, error outError: NSErrorPointer) -> AVMusicTimeStamp

Discussion

This call is only valid if the player is playing and will return 0 with an error if the player is not playing or if the starting time of the player was after the specified host time. This method uses the sequence's tempo map to retrieve a beat time from the starting and specified host time.

See Also

Handling Beat Range

func beats(forSeconds: TimeInterval) -> AVMusicTimeStamp

Gets the beat position (timestamp) for the given time in the track.

typealias AVBeatRange

A specific time range within a music track.