我通过十六进制编辑器打开了一个波形文件。我尝试了两个十六进制编辑器,并且都以相反的顺序将 44100 放入十六进制(AC44)。
这是为什么?对于 ASCII 字符“fmt”,排序是自然的。
这是AC44。
这与Big-Endian / Little-Endian有关吗?但是为什么其他值会以正确的顺序显示呢?
谢谢!
我通过十六进制编辑器打开了一个波形文件。我尝试了两个十六进制编辑器,并且都以相反的顺序将 44100 放入十六进制(AC44)。
这是为什么?对于 ASCII 字符“fmt”,排序是自然的。
这是AC44。
这与Big-Endian / Little-Endian有关吗?但是为什么其他值会以正确的顺序显示呢?
谢谢!
Yes, it is stored in little endian format. The endianness of each field is shown here:
Note that there is a mixture of big and little endian.
It does have to do with endian-ness. The data type you're writing to is an integer which gets stored as a multiple byte chunk.
The reason the text atoms look like they aren't reversed is because they are an ordered list of single byte characters.
Actually it depends on the architecture and/or file format, see e.g. here. You can find both cases, one where the high byte comes first and also where the low byte comes first. In your case it is the first (called litte endian).
因为您的十六进制编辑器正在打印从低地址到高地址的十六进制字节,而小端(例如 x86/ia32)机器将多字节实体的低位存储在低地址中。
如果您想以相反的顺序查看字节,您可以打印从高地址到低地址的内存(但仍然是从左到右),因为在英语国家通常以这种方式打印数字。