• 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
Trying to understand frames/samples, frames within samples etc.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to understand frames/samples, frames within samples etc.


  • Subject: Trying to understand frames/samples, frames within samples etc.
  • From: Ash Gibson <email@hidden>
  • Date: Sun, 02 Sep 2012 21:46:22 +1000

In a callback function, I get the inNumberFrames and ioData args. I then write something like this:

SInt16* samples = (SInt16*)(ioData->mBuffers[0].mData);

which will give me a 16-bit signed integer which is like an array of integers?

I can then loop through it with the inNumberFrames as the total number of elements e.g.

for (int i=0; i < inNumberFrames; i++) {

something = samples[i];

}


When looking at each of these samples that are created inside the for loop e.g. sample[0], sample[1], sample[2] etc. I am trying to visualise what they represent in terms of sound and time.

Is it like this?

              sample[0]      sample[1]      sample[2]
time ------------------------------------------------------------------>

or are these samples actually different parts (e.g. bass, mid range, high) of a sound caught at a point in time e.g.


              sample[2]       sample[2]        sample[2]
              sample[1]       sample[1]        sample[1]
              sample[0]       sample[0]        sample[0]
time ------------------------------------------------------------------>


 _______________________________________________
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: Trying to understand frames/samples, frames within samples etc.
      • From: Aran Mulholland <email@hidden>
  • Prev by Date: Re: Audio Tools for Xcode
  • Next by Date: Re: Trying to understand frames/samples, frames within samples etc.
  • Previous by thread: Re: Audio Tools for Xcode
  • Next by thread: Re: Trying to understand frames/samples, frames within samples etc.
  • Index(es):
    • Date
    • Thread