parsing - RIFF Wave File Format: FourCC values and HEX conversion -
context: parsing riff/wave files. there documentation identifying fourcc values within riff chunks. here more important chunks wave files.
fourcc id 2 .wav specific chunks:
chunk id "fmt " (0x666d7420) chunk id "data" (0x64617461)
so, these fmt values should equal:
string "fmt " hex "666d7420" int "1718449184"
and, these data values should equal:
string "data" hex "64617461" int "1684108385"
now, when read in valid .wav files, fourcc fmtchunkid fmt int always:
fmt int: int "544501094"
and data int always:
data int: int "1635017060"
question: why doesn't documented hex value match int returning stream? i'm guessing don't understand hex int conversion.
extra: found .wav parser code online has suspect fmt value "1718449184". find more fmt value "544501094". finally, search google "1718449184 , 544501094"; nothing.
thank help.
endian. see 0x20746d66 in decimal. (0x20746d66 reversal of bytes of 0x666d7420.)
in file formats, every byte must in correct place. if casually read them in , out of memory, depending on cpu vs file format, can byte orders swapped.
read on "big endian" , "little endian". on @ great great length, it's easy, , important understand if ever dealing file formats, network traffic, interfacing hardware, & many other places.
Comments
Post a Comment