I'm playing with AIFF files, which include an 80-bit "extended" format value which defines the sample rate. Since neither my language of choice, R
, nor my desktop Mac, natively supports this size, I need to write conversion code. Given the data structure of the bits, as shown here, and in this image from that page
,
假设我永远不会看到那么高精度的采样率,我可以简单地截断"分数"部分吗? 也就是说,我可以抓取从左侧开始的64位并将它们视为双浮点吗? 请注意,指数中的有效位数也必须被截断,根据图表为this question
一个最小的例子:我验证了测试文件中的采样率为44100.
从AIFF标头读取的10个字节是:
40 0e ac 44 00 00 00 00 00 00
edit
ac 44
,因为4个原始字节转换为小数变成44100
,这是我期望的采样率.