WAV file headers reporting incorrect size
Posted: Thu Jan 31, 2019 10:49 am
When decoding a WAV file I'm able to read from the header the following values (formatted neatly):
This got me thinking that OpenAL most likely needs me to be offset the header when I start loading in the sample data. However a WAV file's header size is only 44 bytes. I'm also assuming that just offsetting by 46 bytes isn't really a long term solution. So where does the extra 2 bytes come from?
Update:
I tested another file which I downloaded of the internet instead of saving from LMMS. It doesn't play at all even after offsetting by 44 or 46 bytes. Its header is identical except for FileSize: 1242448
When I load this into a OpenAL buffer and attempt to play it back, the sound doesn't play. However after a lots of tweaking, I was able to get the sound to play when I hardcode the FileSize to 907300.Channels: 2
BitDepth: 16
SampleRate: 44100
FileSize: 907346
FileType: RIFF
AudioFileType: WAVE
data: [...]
PCM: 0
This got me thinking that OpenAL most likely needs me to be offset the header when I start loading in the sample data. However a WAV file's header size is only 44 bytes. I'm also assuming that just offsetting by 46 bytes isn't really a long term solution. So where does the extra 2 bytes come from?
Update:
I tested another file which I downloaded of the internet instead of saving from LMMS. It doesn't play at all even after offsetting by 44 or 46 bytes. Its header is identical except for FileSize: 1242448