WAV file headers reporting incorrect size

Having trouble with LMMS? Ask about it here.
When decoding a WAV file I'm able to read from the header the following values (formatted neatly):
Channels: 2
BitDepth: 16
SampleRate: 44100
FileSize: 907346
FileType: RIFF
AudioFileType: WAVE
data: [...]
PCM: 0
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.

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
angela245 wrote:
Thu Jan 31, 2019 10:49 am
When decoding a WAV file
Lets see if i understand this correctly.
You have exported from LMMS to a wave-file, and when you examined that file, the header did not contain the information you expected/ had chosen, in the export menu.
Is that correct?
If so, please be more specific, what parameters did you select, and what was these changed to, in the exported wave?

If you ask a general question about wave-file headers, then this is not the right forum.
I can tell you how I wrote the header in a as program I wrote years back. Here the header is:

Code: Select all

/*
(4) S: RIFF
(4) R: Size of entire file - 8 (little endian)
(4) S: WAVE
(4) S: fmt                          <---Make sure there is a space after!
(4) R: Size of chunk (Normally 16 in non-compressed data) (little endian)
(2) R: Format (If it's not compressed (PCM), then it will be the value 1) (little endian)
(2) R: Number of chanels (to make it esay, put 1) (little endian)
(4) R: Sample rate ( 8000, 44100, etc.) (little endian)
(4) R: Byte rate (SampleRate * NumChannels * BitsPerSample/8 (little endian)
(2) R: Block Align (NumChannels * BitsPerSample/8) (little endian)
(2) R: Bits per sample (e.g. 8 = 1 byte (8 bits), 16 = 2 bytes (16 bits), etc...) (little endian)
(4) S: data
(4) R: Size of data (NumSamples * NumChannels * BitsPerSample/8) (little endian)
(*) R: The actual data
*/

Beside that, since you are new in Forum
Welcome angela245 !
Here are all important links:
http://lmms.io/forum/viewtopic.php?f=1&t=4740
-A few rules and useful forum instructions