• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AudioGetCurrentHostTime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioGetCurrentHostTime


  • Subject: Re: AudioGetCurrentHostTime
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 03 Feb 2009 10:11:46 -0800


On Feb 3, 2009, at 3:58 AM, IainS wrote:

Hello,

(this discussion concerns 10.4.11 [intel and ppc] --- a client constraint, so "change to 10.5" is not a useful option).

I want to reference timestamped data between a non-audio app and an audio app.

The AudioGetCurrentHostTime/AudioConvertHostTimeToNanos interface seems like it should do the trick...
(my simplistic expectation was that *host* time would be independent of presence/absence of a running audio interface).


However, when I call it from an application with no audio context - the value returned by AudioGetCurrentHostTime doesn't change.

If I call mach_absolute_time() in the same position - this works fine.

So:

1/ Is this expected behavior (i.e. "Audio" host time doesn't change unless there's an established audio interface in the app)?

Not at all.

In fact, I just wrote a quick command line tool that spins in a while(1) loop and prints the return value of AudioGetCurrentHostTime(). It worked just fine.


2/ Is AudioGetCurrentHostTime == mach_absolute_time() ?

Yup. The API in <CoreAudio/HostTime.h> is actually just a wrapper around our CAHostTimeBase class from the PublicUtility section of our SDK (which is a wrapper around mach_absolute_time() and friends).


You can see all the gory details of it's implementation in our SDK.


3/ Is there any reason that I might expect a problem calling these interfaces on multiple threads?

(I have not seen any difficulty when using these interfaces in audio contexts).


No. This API is as thread-safe as mach_absolute_time() is.

--

Jeff Moore
Core Audio
Apple


_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >AudioGetCurrentHostTime (From: IainS <email@hidden>)

  • Prev by Date: Re: playback of purchased music in iTunes via core audio
  • Next by Date: MP3 and AAC licenses for iPhone
  • Previous by thread: AudioGetCurrentHostTime
  • Next by thread: audio queue play from memory source
  • Index(es):
    • Date
    • Thread