HydrogenAudio

Lossless Audio Compression => Lossless / Other Codecs => Topic started by: poochi on 2013-02-19 09:52:03

Title: WAV header
Post by: poochi on 2013-02-19 09:52:03
how is the wreserved field in set in the wav header while decoding .Flac files using flac 1.2.1 win32 exe  ?
ie If i decode a flac file using flac-1.2.1.exe few files have wreserved field to be 0x10 and few others 0x18 .. but http://msdn.microsoft.com/en-us/library/wi...1(v=vs.85).aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/dd390971(v=vs.85).aspx) says i need to make it 0 what exactly is happening ?

Thank you


Title: WAV header
Post by: nu774 on 2013-02-19 10:40:44
Samples field of WAVEFORMATEXTENSIBLE is a discriminated union, and only one of wValidBitsPerSample, wSamplesPerBlock, and wReserved are valid / used, depending on the context.
For detail, read http://msdn.microsoft.com/en-us/library/wi...e/gg463006.aspx (http://msdn.microsoft.com/en-us/library/windows/hardware/gg463006.aspx)

In your case, this field is used not as wReserved, but as wValidBitsPerSample. Therefore, 0x10 means bits per sample is 16, and 0x18 means 24.
Title: WAV header
Post by: poochi on 2013-03-08 09:07:49
Thank you it was very helpful