There is another things that bothers me: The while loop in parse_wave_form(): - WAVE file chunk order is fmt and then data - The last fmt or data chunk will "win"; doubt there are any dmusic related WAVE files with duplicate fmt or data chunks.
But for now we can start with the while() loop: - No clue where those extra chunks are placed - We don't do anything with the WAV file; we just store it. Though we might run into memory issues with big WAV files.