Reputation: 659
I'm reading through the Core Audio documentation and specifically an example for calculating a buffer size based on packet information in an audio file. Because this topic is so nuanced I want to make sure I understand things clearly. In the function they define these constants:
static const int maxBufferSize = 0x10000; // limit maximum size to 64K
static const int minBufferSize = 0x4000; // limit minimum size to 16K
It seems to me that these values are not precise based on those comments. The hexadecimal number 0x10000 is 65536 in decimal. Whereas there are only 64k bytes in 64K (I'm assuming that means kilobytes?). The same goes for 0x4000 which is 384 decimal value greater than 16kb's if my arithmetic is right.
I'm just curious if these things are meant to be rough values. Given that Core Audio is relatively complex I want to make sure I'm not missing something here.
Upvotes: 0
Views: 190
Reputation: 70693
When referring to amounts of computer memory, the suffix "K" usually (but not always) means multiples of 1024, not 1000.
Core Audio very often (but not always) returns sample buffers that are a power of 2 is size.
Upvotes: 1