- Did you do what jeroenb suggested and open the file as a binary file (as "rb") (you should be doing this anyway, even if your problem persists)?
- Are you checking the status of the file with ferror and feof?
- Are you sure fread is reading the requested number of bytes (it can read fewer than requested)?
- Are you 100% sure this is a 16-bit, 2 channel PCM WAV file?
- Have you properly read the "unnecessary info of sound" and verified that you're getting what you expect in the header?
- Is ivb == size of the file in bytes - 44?
Also, 16 bit PCM WAV files use signed numbers (you should be using short), not unsigned numbers (you shouldn't be using unsigned short) (you'll get the wrong values). And sizeof(BYTE) isn't intuitive, as a BYTE should always have a size of 1 (and if it's more than that for some broken reason, you'll read too much and go past the header).