Does anybody know to store 20 bit audio samples in the WAVE format? It is obvious how to strore 8, 16, 24, and 32 bit samples. However it is not so clear on how to store 20 bit samples. One possibility is to use 2 and a half bytes but that would be quite an ugly way, as some bytes in the stream would be have one half used by one sample and another half for another sample.
According to "Enhanced Audio Formats For Multi-Channel Configurations And High Bit Resolution" from Microsoft, is suggests to store 20 bit samples in 24 bit containers. They give the following example for storing a stereo 20 bit stream:
Byte 1 – Channel 1, Left Front, Low Order Byte, only top four bits have valid data
Byte 2 – Channel 1, Left Front, Mid Order Byte, all valid data
Byte 3 – Channel 1, Left Front, High Order Byte, all valid data
Byte 4 – Channel 2, Right Front, Low Order Byte, top four bits have valid data
Byte 5 – Channel 2, Right Front, Mid Order Byte, all valid data
Byte 6 – Channel 2, Right Front, High Order Byte, all valid data
Byte 7 – Channel 1, Left Front, Low Order Byte, top four bits have valid data, Sample 2
Byte 8 – Channel 1, Left Front, Mid Order Byte, all valid data, Sample 2
etc.
However, according to this,the signal would no longer be a 20 bit signal, but 24. This would be quite a waste of storage space and bandwidth.
Does anybody know more about this?
Thanks,
Aristotel
