I am having an issue on writing a wav file with int16 data. For testing I made a file with sample =-32768 then each sample increments on up to sample = 32767.
The issue is values greater than 16384 (+0.5f) are written one bit value too low.
sample= should be 16385 (0.500031f) but is 16384 (0.5f)
sample= should be 16386 (0.500061f) but is 16385 (0.500031f)
The attached zip has a console app that reads the input file and compares it to what the values should be (in floats). It then writes the data from the file into a second file and compares it to what it should be.
Float32 data works with no issues.
WavFileTest.zip (118.4 KB)