I am trying to generate a 32bit PCM wav file with octave, the file shall contain a single full-scale sample (0db impulse). I am getting the expected result when using 24 bits per sample:
>> wavwrite(1, 96000, 24, 'foo.wav'); >> wavread('foo.wav') ans = 1.00000 # as expected
However, when using 32 bits per sample, the value seems to overflow.
>> wavwrite(1, 96000, 32, 'foo.wav'); >> wavread('foo.wav') ans = -1 # WHAT ?!
I am expecting the second
wavread('foo.wav') to return
-1. I have checked the wav file with a hex editor, the sample raw value is
0x80000000, I am expecting it to be
Is it an octave bug or am I missing something?
0.99999 instead of
1 generates the expected result.