I'm writing a parser for wave files in C++, designed to work with XAudio2.
I have no problems reading in PCM wave files. My parser extracts the chunk size for the format chunk of a PCM file as 16 bytes. I copy this data into a WAVEFORMATEX or WAVEFORMATEXTENSIBLE struct and it fills struct as I expect.
I used the "AdpcmEncode" utility that comes with the June 2010 DirectX SDK to encode my PCM file to ADPCM.
Now my parser extracts the size of the format chunk as 50 bytes.
I notice that the size of the WAVEFORMATEXTENSIBLE struct is 40 bytes. Is there something wrong with my parser here or is there another type of struct that I should be copying this data to?
The parser seems to be working OK as from the ADPCM file I extract wFormatTag = 2 (i.e. ADPCM encoding) and cbSize = 32 (i.e. 32 extra bytes + 18 bytes for the WAVEFORMATEX struct = 50 bytes total). I'm wondering why this chunk won't fit into a WAVEFORMATEXTENSIBLE struct and what the extra 10 bytes of data might be for.
Any help here will be much appreciated.