• 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: A number of simple questions (still a few unanswered)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A number of simple questions (still a few unanswered)


  • Subject: Re: A number of simple questions (still a few unanswered)
  • From: Seth Willits <email@hidden>
  • Date: Wed, 06 Feb 2013 16:44:58 -0800

On Feb 6, 2013, at 4:12 PM, René J.V. Bertin wrote:

>>>> - Why is AudioTimeStamp.mSampleTime a float if it's an integer number of samples?
>>
>> Still curious why it's a Float64 in the first place. :)
>
> Who says there's an integer number of samples in a second, and not in say, 3 seconds? And how else would you represent the sample duration for a rate of, say, 17 samples per second?


Forgive me since it's already been a few months since I was knee deep in Core Audio, but …


That's what mSampleRate is for not, mSampleTime.  mSampleTime is the "n"  in "the nth sample."


For example:

memset(&timeStamp, 0, sizeof(timestamp));
timestamp.mSampleTime = 0;
timestamp.mFlags = kAudioTimeStampSampleTimeValid;

for (int sampleIndex = 0; sampleIndex < 44100; sampleIndex += 512) {
	...
	timestamp.mSampleTime = (Float64)sampleIndex;
	AudioUnitRender(outputUnit, &actionFlags, &timestamp, 0, 512, audioBufferList);
	...
}


AFAICT it's always an integer value.


--
Seth Willits
 _______________________________________________
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: A number of simple questions (still a few unanswered)
      • From: Jeff Moore <email@hidden>
References: 
 >Re: A number of simple questions (still a few unanswered) (From: James McCartney <email@hidden>)
 >Re: A number of simple questions (still a few unanswered) (From: Paul Davis <email@hidden>)
 >Re: A number of simple questions (still a few unanswered) (From: Seth Willits <email@hidden>)
 >Re: A number of simple questions (still a few unanswered) (From: "René J.V. Bertin" <email@hidden>)

  • Prev by Date: Re: A number of simple questions (still a few unanswered)
  • Next by Date: Re: A number of simple questions (still a few unanswered)
  • Previous by thread: Re: A number of simple questions (still a few unanswered)
  • Next by thread: Re: A number of simple questions (still a few unanswered)
  • Index(es):
    • Date
    • Thread