Re: DefaultOutputDevice timestamps
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!