AIFF 小檔案

AIFF 全名 audio interchange file format, 我們沒說要支援, 結果播起來有聲音, 被客戶發 bug, 成了傷腦筋的問題.

為什麼沒有支援也可以播呢?因為它有時並沒有壓縮, 和純 PCM 的 wave 檔差不多.

如果名稱是 *.AIFF 或 *.AIF, 檔案是 little endian. 如果名稱是 *.AIFC, 則為 big endian.

不過 iTune 的 AIFF 內容其實是 AIFC. 這就是為何我們改口說 "乾脆支援 AIFF 算了!" 結果反而又被發 3 個 bug 的原因.

 AIFF 和 WAV (RIFF)  檔簡單比較一下:

RIFF Note AIFF Note
Chunk ID RIFF Chunk ID FORM
Chunk Size 4 Bytes Chunk Size 4 Bytes
RIFF DATA WAVE form data AIFF
 一到多個 chunk   各種 chunk 1
Offset Size Description Value
0×00 4 Chunk ID "fmt " (0x666D7420)
0×04 4 Chunk Data Size 16 + extra format bytes
0×08 2 Compression code 1 – 65,535
0x0a 2 Number of channels 1 – 65,535
0x0c 4 Sample rate 1 – 0xFFFFFFFF
0×10 4 Average bytes per second 1 – 0xFFFFFFFF
0×14 2 Block align 1 – 65,535
0×16 2 Significant bits per sample 2 – 65,535
0×18 2 Extra format bytes 0 – 65,535
0x1a
Extra format bytes *
Common Chunk
Sound Data Chunk
Name Chunk
Author Chunk
Copyright Chunk
Annotation Chunk
Audio Recording Chunk
Application Chunk
ID3 Chunk
MIDI Data Chunk
未壓縮
Code Description
0 (0×0000) Unknown
1 (0×0001) PCM/uncompressed
2 (0×0002) Microsoft ADPCM
6 (0×0006) ITU G.711 a-law
7 (0×0007) ITU G.711 µ-law
17 (0×0011) IMA ADPCM
19 (0×0013) ADPCM (Sierra)
20 (0×0016) ITU G.723 ADPCM (Yamaha)
49 (0×0031) GSM 6.10
64 (0×0040) ITU G.721 ADPCM
80 (0×0050) MPEG
257 (0×0101) IBM µ-law
258 (0×0102) IBM a-law
259 (0×0103) IBM AVC Adaptive Differential PCM
65,536 (0xFFFF) Experimental

NONE (未壓縮)

fl32 (32 bits floating)
fl64 (64 bits floating)
a-law
u-law
FL32 (32 bits floating)
ADP4 (4:1 Intel/DVI ADPCM)
ima4 (IMA 4:1)
ACE2 (ACE 2-to-1)
ACE8 (ACE 8-to-3)
DWVW(Delta With Variable Word Width)
MAC3 (MACE 3-to-1)
MAC6 (MACE 6-to-1)
Qclp (Qualcomm PureVoice)
QDMC (QDesign Music)
rt24 (RT24 50:1)
rt29 (RT29 50:1) 

壓縮格式, 寫在 Common chunk

 
 

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>