I captured raw audio data stream together with its **WAVEFORMATEXTENSIBLE** struct. 
**WAVEFORMATEXTENSIBLE** is shown in the figure below:

![The WAVEFORMATEXTENSIBLE struct](https://i.stack.imgur.com/2SJ1Z.png)

Following the [standard](http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html) of wav file, I tried to write the raw bits into a wav file.
What I do is:

1. write "RIFF".
2. write a DWORD. (filesize - sizeof("RIFF") - sizeof(DWORD)).

**=== WaveFormat Chunk ===**

3. write "WAVEfmt "
4. write a DWORD. (size of the WAVEFORMATEXTENSIBLE struct)
5. write the WAVEFORMATEXTENSIBLE struct.

**=== Fact Chunk ===**

6. write "fact"
7. write a DWORD. ( 4 )
8. write a DWORD. ( num of samples in the stream, which should be sizeof(rawdata)\*8/wBitsPerSample ).

**=== Data Chunk ===**

9. write "data"
10. write a DWORD (size of rawdata)
11. write the raw data.

After getting the wav file from the above steps, I played the wav file with media player, there is no sound, playing with audacity will give me a distorted sound, I can hear that it is the correct audio I want, but the sound is distorted with noise.

The raw data can be find [here](https://docs.google.com/open?id=0B5bEhIhshfIeOG9PZTdIT19pd2s)

The wav file I generate is [here](https://docs.google.com/open?id=0B5bEhIhshfIeWlA3NHBYS1MyU3M)

It is very confusing to me, because when I use the same method to convert IEEE-float data to wav file, it works just fine.