Re: HostTime -> real time clock time (NTP time)
Re: HostTime -> real time clock time (NTP time)
- Subject: Re: HostTime -> real time clock time (NTP time)
- From: Jeff Moore <email@hidden>
- Date: Thu, 16 Aug 2001 14:44:54 -0700
on 8/16/01 2:32 PM, James McCartney <email@hidden> wrote:
>
UCB CNMAT's Open Sound Control protocol uses an NTP format time stamp to
>
time events. I would need to know the absolute real time clock time (NTP
>
time) that a sample will be performed.
>
How does one convert the AudioTimeStamp mHostTime to a real time clock time?
<CoreAudio/HostTime.h> has routines for querying the clock frequency and to
convert a host time to a time in nanoseconds and back.
From there you are on your own for the most part. Presumably you need to
have an anchor point where you can relate an NTP to to a host time (in nanos
or in absolute units, doesn't really matter which). From the anchor point,
you will also need to do a little dead reckoning to account for the drift
between NTP and the clock on the CPU and the drift between the sample clock
and the host time clock as indicated in the HAL's time stamps.
--
Jeff Moore
Core Audio
Apple