Search code examples
iosaudiotoolboxmikmidi

Convert MusicTimeStamp (AudioToolbox) to Milliseconds


I am using the MIKMIDI framework and this is using the AudioToolbox type MusicTimeStamp

How can i convert this timestamp to milliseconds?


Solution

  • The MusicTimeStamp is a raw beat count, you need to know the tempo (and tempo map, tempo isn't an invariant) of the music you're working with in order to convert this into milliseconds.

    Outside of a MusicSequence a MTS can't be mapped to a wall time.

    Edit: A CoreMedia CMTime can be converted to wall times if that helps.