• 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: DefaultOutputDevice timestamps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DefaultOutputDevice timestamps


  • Subject: Re: DefaultOutputDevice timestamps
  • From: Kurt Revis <email@hidden>
  • Date: Wed, 24 Oct 2001 14:06:28 -0700

Your Objective-C stuff is fine. Here is the real problem:

NSLog(@"In audioCallback inOutputTime.mHostTime = %llu \n",
inOutputTime->mHostTime);

NSLog does not handle format specifiers for long longs. The value inOutputTime->mHostTime is fine (that's why playing sound works), but it is being output as garbage.

Unfortunately, there's no way you would have known this. The NSLog documentation refers you to the NSString documentation, which says "NSString supports the format characters defined for the ANSI C function printf()". This is not true, and hasn't been true for ages, but still no one has fixed the NSString methods or the documentation. Humph.

A workaround would be to format a string using sprintf (which should handle long longs correctly) and then give that to NSLog to output.

(As a side note: You don't need to add a \n at the end of your NSLog string. A newline is added for you automatically.)

Hope this helps!


  • Follow-Ups:
    • Re: DefaultOutputDevice timestamps
      • From: email@hidden
References: 
 >Re: DefaultOutputDevice timestamps (From: email@hidden)

  • Prev by Date: Re: DefaultOutputDevice timestamps
  • Next by Date: Re: DefaultOutputDevice timestamps
  • Previous by thread: Re: DefaultOutputDevice timestamps
  • Next by thread: Re: DefaultOutputDevice timestamps
  • Index(es):
    • Date
    • Thread