8.24 fixed-point format on iPhone -- what is in the integer portion?
8.24 fixed-point format on iPhone -- what is in the integer portion?
- Subject: 8.24 fixed-point format on iPhone -- what is in the integer portion?
- From: David Zhang <email@hidden>
- Date: Tue, 08 Feb 2011 00:39:18 -0800
Hello,
Sorry if this is a silly question as I am fairly new to this. I am
looking at the aurioTouch code, specifically the PerformThru function
where AudioUnitRender gets called. Here, the AudioBufferList* ioData has
the sound data in 8.24 fixed-point format. My novice understanding of
this format is that the most significant 8 bits are the integer portion
with range [0, 255] and the next 24 bits are the fractional part with
range [0, 1).
But whenever I look at the most significant 8 bits, they are always
either 0x00 or 0xff, never anything in between. And the aurioTouch code
only looks at the second most significant 8 bits when drawing the
oscilloscope:
SInt8 *data_ptr = (SInt8 *)(ioData->mBuffers[0].mData);
for (i=0; i<inNumberFrames; i++)
{
if ((i+drawBufferIdx) >= drawBufferLen)
{
cycleOscilloscopeLines();
drawBufferIdx = -i;
}
drawBuffers[0][i + drawBufferIdx] = data_ptr[2];
data_ptr += 4;
}
data_ptr[0] would be the least-significant 8 bits and data_ptr[3] would
be the most-significant 8 bits since the iPhone is little-endian. The
oscilloscope is only looking at data_ptr[2].
So what is in the most significant 8 bits and why is it always 0x00 or 0xff?
Thanks in advance!
_______________________________________________
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