Re: Why is AudioGetHostClockFrequency returning zero?
Re: Why is AudioGetHostClockFrequency returning zero?
- Subject: Re: Why is AudioGetHostClockFrequency returning zero?
- From: Kurt Revis <email@hidden>
- Date: Sun, 5 Oct 2003 02:26:11 -0700
On Sunday, October 5, 2003, at 12:07 AM, Mark Woollard wrote:
I'm trying to use AudioGetHostClockFrequency to convert a
MidiTimeStamp to ms but it just seems to return zero.
Works fine for me. This program:
#include <CoreServices/CoreServices.h>
#include <CoreAudio/HostTime.h>
int main (int argc, const char * argv[]) {
Float64 freq = AudioGetHostClockFrequency();
printf("Frequency: %g\n", freq);
return 0;
}
prints
Frequency: 2.49068e+07
which is about 25 MHz, which is exactly what I expect (on a G4 with a
100 MHz system bus, running 10.2.8).
What's going on?
Hard to tell without more information about your hardware and what
version of the OS you're running, and maybe the actual code you're
using which is returning 0.
Also note that AudioGetHostClockFrequency() returns a floating point
value. Possibly you are doing some conversion to or from integers
incorrectly? You are probably better off using
AudioConvertHostTimeToNanos(), which returns an integer value.
--
Kurt Revis
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.