I am attempting to read audio data via AudioQueue. When I do so, I can verify that the bit depth of the file is 16-bit. But when I get the actual sample data, I\'m only seei
char *buffer= NULL;
That's the reason. You're iterating over signed bytes, not 16-bit samples.
Declare the variable as holding a pointer to two-byte values instead:
SInt16 *buffer = NULL;
Then, iterate over half as many samples as bytes:
for(int i=0;i < (BUFFER_SIZE / sizeof(*buffer));i++){
NSLog(@"%i", buffer[i]);
}
I would rename BUFFER_SIZE
to BUFFER_SIZE_BYTES
to clarify it.