Help - Search - Members - Calendar
Full Version: 20 bit wav file structure
Hydrogenaudio Forums > Hydrogenaudio Forum > Scientific Discussion
greekgoddj
Greetings,

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. blink.gif

Does anybody know more about this?

Thanks,

Aristotel
Garf
Basically, what you descibe is entirely correct, and there is nothing more to say... smile.gif
greekgoddj
QUOTE(Garf @ Sep 5 2005, 05:57 PM)
Basically, what you descibe is entirely correct, and there is nothing more to say... smile.gif
*



Hhhmmm....and I thought I was missing something somewhere.

OK then biggrin.gif

Thanks
greekgoddj
By the way,

does anybody know where I can find information about the storing of audio (byte structures etc) for DVD?I can only find general information like sample rates, number of channels, and bit depths supported, not how the DVD standard stores them.

This is for uncompressed audio on dvd by the way.

thanks
pest
don't know if you already know this

be sure to write 20-bit data to an wave-format-extensible file
the blockalign-field gets the 'containersize' and the dwValidBits-field the
original bitdept. otherwise the file would be recognized as a 24-bit file
if the decoder doesn't check for bitshifts...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.