• 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: Sample Rate: 44100 or 48000
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sample Rate: 44100 or 48000


  • Subject: Re: Sample Rate: 44100 or 48000
  • From: Marc Van Olmen <email@hidden>
  • Date: Sun, 14 Aug 2005 13:10:13 -0400


On Aug 14, 2005, at 11:23 AM, Marc Van Olmen wrote:

to answer this part of the question my self found some sample code and created this:

typedef double OS_TimeValue;
AudioTimeStamp theCurrentTime;
OSStatus anError;

theCurrentTime.mHostTime = 0;
theCurrentTime.mRateScalar = 0;
theCurrentTime.mReserved = 0;
theCurrentTime.mSampleTime = 0;
//theCurrentTime.mSMPTETime = 0;
theCurrentTime.mWordClockTime = 0;
theCurrentTime.mFlags = kAudioTimeStampSampleTimeValid | kAudioTimeStampHostTimeValid;



anError = AudioDeviceGetCurrentTime(fOSMovie->fAudioClockDeviceID, &theCurrentTime);
pDeviceClock- >setTime((OS_TimeValue)AudioConvertHostTimeToNanos(theCurrentTime.mHost Time),kOS_TimeToNanoSeconds);

I'm wondering this code is not wrong? shouldn't I add "AudioDeviceTranslateTime"?????

I'm wondering if the 'AudioConvertHostTimeToNanos' works only in the macOS x hardware clock??? and not from my device???? because how does it now the clock frequency of the device?? maybe this is stored inside the mHostTime value???
I just doubt it a little bit?


So maybe this is then more Correct?????

typedef float64 OS_TimeValue;
AudioTimeStamp theCurrentDeviceTime;
AudioTimeStamp theCurrentTimeInMacOSXHardware;
OSStatus anError;

theCurrentDeviceTime.mHostTime = 0;
theCurrentDeviceTime.mRateScalar = 0;
theCurrentDeviceTime.mReserved = 0;
theCurrentDeviceTime.mSampleTime = 0;
//theCurrentTime.mSMPTETime = 0;
theCurrentDeviceTime.mWordClockTime = 0;
theCurrentDeviceTime.mFlags = kAudioTimeStampSampleTimeValid | kAudioTimeStampHostTimeValid;



anError = AudioDeviceGetCurrentTime(fOSMovie->fAudioClockDeviceID, & theCurrentDeviceTime);
FW_FAIL(anError);
anError = AudioDeviceTranslateTime(fOSMovie->fAudioClockDeviceID, & theCurrentDeviceTime, & theCurrentTimeInMacOSXHardware);
FW_FAIL(anError);

// Time can now be converted to my NanoSeconds precisions clock
pDeviceClock- >setTime((OS_TimeValue)AudioConvertHostTimeToNanos(theCurrentTimeInMacOS XHardware.mHostTime),kOS_TimeToNanoSeconds);



I'm aware that the fOSMovie->fAudioClockDeviceID needs to be running to make this work....


_______________________________________________
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


  • Follow-Ups:
    • Re: Sample Rate: 44100 or 48000
      • From: Jeff Moore <email@hidden>
    • Re: Sample Rate: 44100 or 48000
      • From: Marc Van Olmen <email@hidden>
References: 
 >Sample Rate: 44100 or 48000 (From: Marc Van Olmen <email@hidden>)
 >Re: Sample Rate: 44100 or 48000 (From: Marc Van Olmen <email@hidden>)

  • Prev by Date: Re: Sample Rate: 44100 or 48000
  • Next by Date: RE: AURenderCallback inputs...
  • Previous by thread: Re: Sample Rate: 44100 or 48000
  • Next by thread: Re: Sample Rate: 44100 or 48000
  • Index(es):
    • Date
    • Thread