Trying to understand frames/samples, frames within samples etc.
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