With AudioConverter, the bit rate property only applies to certain codecs, never PCM.
12 bits, unpacked, aligned high is essentially the same as 16-bit with the lower 4 bits clear.
Thanks for clarifying that Doug. This is what I'm trying to accomplish here I'm planning to send this of to a sampler, but I have doubts that this is what gets to the file. BTW, I'm only writing this to the file to confirm that the format is correct at this point. It will remain in the buffer later on. I have tried to print each sample in binary representation to the terminal to confirm that the low 4 bits are zero and it, appears that all 16 bit's are still used.
Calling:
CAShow(converter);
After the call to AudioConverterFillComplexBuffer, gives me this:
AudioConverter 0xe780001 [0x100113220]:
PCMConverter2 0x0x1001134a0
Input: 1 ch, 44100 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
Output: 1 ch, 44100 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
SampleRateConverter 0x0x10010e350
Input: 1 ch, 44100 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
Output: 1 ch, 26040 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
PCMConverter2 0x0x100113630
Input: 1 ch, 26040 Hz, 'lpcm' (0x00000009) 32-bit little-endian float
Output: 1 ch, 26040 Hz, 'lpcm' (0x00000014) 12-bit little-endian signed integer, unpacked in 2 bytes high-aligned
A sample of what is printed to the terminal when I print each byte as bin from the resulting .caf file:
1111011110101010
1111011111010010
1111011110010110
1111011100011000
I then, as a test open up the file and do this to each sample (unsigned short) and write it back
buf[i] &= 0xfff0;
Which gives me this:
1111011110100000
1111011111010000
1111011110010000
1111011100010000
The file still plays fine and it appears that the low 4 bit's have now been cleared.
Thanks.