• 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: Float64 to unsigned bug shows in mSampleTime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Float64 to unsigned bug shows in mSampleTime


  • Subject: Re: Float64 to unsigned bug shows in mSampleTime
  • From: Doug Wyatt <email@hidden>
  • Date: Sun, 25 Aug 2002 13:12:15 -0700

On Saturday, Aug 24, 2002, at 00:40 US/Pacific, email@hidden wrote:
A related question - is there any reason for me to leave the
mSampleTime field as a Float64? I mean, is the fractional part of the
mSampleTime field of any value to me as a user of Apple APIs which supply
me with AudioTimeStamps or would I be just as well off to replace it with
SInt64s by wrapping around any occurrences of AudioTimeStamps?

Personally I'd first consider using UInt32's, which are cheaper than 64-bit ints:

- on my first IOProc callback, remember the first mSampleTime I see as a Float64, call it "zeroTime"
- on subsequent callbacks, subtract zeroTime from mSampleTime, and store it in a UInt32.

Time will only go forward :-)

Note: if you need to run for more than 27 hours at 44.1, or shorter periods at higher sample rates, then you do need more than 32 bits.

secondsPerHour = 3600.;
(pow(2,32) / 44100. / secondsPerHour) = 27.05

Doug
_______________________________________________
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.

  • Follow-Ups:
    • Re: Float64 to unsigned bug shows in mSampleTime
      • From: email@hidden
References: 
 >Re: Float64 to unsigned bug shows in mSampleTime (From: email@hidden)

  • Prev by Date: Re: iMic
  • Next by Date: Re: iMic
  • Previous by thread: Re: Float64 to unsigned bug shows in mSampleTime
  • Next by thread: Re: Float64 to unsigned bug shows in mSampleTime
  • Index(es):
    • Date
    • Thread