Contents

MusicPlayerGetBeatsForHostTime(_:_:_:)

Gets the beat number associated a specified host time.

Declaration

func MusicPlayerGetBeatsForHostTime(_ inPlayer: MusicPlayer, _ inHostTime: UInt64, _ outBeats: UnsafeMutablePointer<MusicTimeStamp>) -> OSStatus

Parameters

  • inPlayer:

    The music player that you are querying.

  • inHostTime:

    The host time that you want the beat number for.

  • outBeats:

    On output, the beat number associated with the inHostTime value.

Return Value

A result code. This function returns an error if the player is not playing.

Discussion

This function is valid only if the music player is playing. For converting between beats and seconds, see MusicSequenceGetSecondsForBeats(_:_:_:) and MusicSequenceGetBeatsForSeconds(_:_:_:).

See Also

Managing a Music Player