cwavtextpad

Open a wav file to read data in text editor vs in sndfile


I want to read the data of an 8bit wav file using textPad, I know that the data is located at the 44/46th byte, but I am having problems reading it.

I have that code:

52 49 46 46 F8 37 01 00 57 41 56 45 66 6D 74 20
12 00 00 00 06 00 01 00 40 1F 00 00 40 1F 00 00
01 00 08 00 00 00 66 61 63 74 04 00 00 00 C6 37
01 00 64 61 74 61 C6 37 01 00 D6 D4 56 54 D5 56
56 51 D4 D3 D0 D6 54 57 D4 54 57 51 57 D0 D3 D1

etc.

The part in bold is the data of it.

The problem is when i read it in sndfile using sf_read_int I get in the buffer the following values:

3670016  1572864  -3670016   -1572864   524288   -3670016   -3670016 

etc

How am I supposed to read the data in the wav file? What is the equation or 'relationship' between the numbers i got in sndfile and the data in textPad?

Oh and one more thing, if i switch the reading to sf_read_float instead of int i get values between -0.0001 and +0.0001...

Any idea what's happening, the writing and data processing is very good but I don't understand what's up with these values.

Thank you.


Solution

  • Okay so i found out that the wav file is encoded and libsndfile takes care of it without any intervention. That caused the "unequal" values.