申明:本博客所有标注为原创的文章均为本人原创,非商业目的转载和摘录请注明链接地址,如需商业用途请与本人联系。
APE是一种无损音频格式,主页:http://monkeysaudio.com/,在其主页可以下载到MAC_SDK,实际上是编码器源代码和解码器源代码以及一些封装库。有关APE文件结构的信息包含在\Source\MACLib 目录下的APEHeader.h,MACLib.h 二个文件中。
Old APE files (3.97 and earlier)
名称 | 大小 | 含义 |
APEtag | 4Byte | "MAC " 0x4D414320 |
Version | 2Byte | 版本号 |
DescriptorLength | 4Byte | the number of descriptor bytes |
HeaderLength | 4Byte | header大小 |
CompressionLevel | 2Byte | 压缩级别 |
FormatFlags | 2Byte | 压缩标记 (保留,未使用) |
NumChannels | 2Byte | 声道数 |
SampleRate | 4Byte | 采样率 |
wavHeaderLength | 4Byte | WAV 头部长度 |
wavTailLength | 4Byte | WAV 尾部长度 |
TotalFrames | 4Byte | Frame总数 |
FinalFrameBlocks | 4Byte | 后一个frame 包含的samples数量 |
New APE files (3.98 and after)
名称 | 大小 | 含义 |
APE tag | 4Byte | "MAC " 0x4D414320 |
Version | 2Byte | 版本号 |
padding | 2Byte | 00 00 |
DescriptorLength | 4Byte | the number of descriptor bytes |
HeaderLength | 4Byte | header大小 |
SeekTableLength | 4Byte | seek table 大小 |
wavHeaderLength | 4Byte | WAV 头部长度 |
AudioDataLength | 4Byte | the number of bytes of APE frame data |
AudioDataLengthHeigth | 4Byte | the high order number of APE frame data bytes |
wavTailLength | 4Byte | WAV 尾部长度 |
md5 | 16Byte | 文件MD5 |
CompressionLevel | 2Byte | 压缩级别 |
FormatFlags | 2Byte | 压缩标记 (保留,未使用) |
BlocksPerFrame | 4Byte | 一个frame 包含audio blocks的数量 |
FinalFrameBlocks | 4Byte | the number of audio blocks in the final frame |
TotalFrames | 4Byte | frames 总数 |
bps | 2Byte | 采样位数 |
NumChannels | 2Byte | 声道数 |
SampleRate | 4Byte | 采样率 |
APE文件中可以包含三种类型的TGA:APETag1.0,APETag2.0,ID3v1.1。tga(标签)一般被保存在文件末端。
APETag具体结构可以参考 \Source\MACLib 目录下APETag.h
APETag 结构
名称 | 大小 | 含义 |
ID | 8Byte | APETAGEX |
Version | 4Byte | 2000 (0x07 D0)1.0 1000 (0XE8 03)2.0 |
Size | 4Byte | APE_TAG_HEADER:APE_TAG _HEADER_BYTES APE_TAG_FOOTER:APE_TAG _HEADER_BYTES |
FieldsNum | 4Byte | 标签中包含的成员数量 |
Flags | 4Byte | 标签标记 APE_TAG _HEADER:1 << 31 (0x80 00 00 00) APE_TAG_FOOTER:1 << 30 (0xA0 00 00 00) |
Reserved | 8Byte | 未使用(全部为零) |
参考链接:
http://wiki.hydrogenaud.io/index.php?title=APEv2_specification
http://wiki.hydrogenaud.io/index.php?title=APE_Tags_Header
http://wiki.hydrogenaud.io/index.php?title=APE_Tag_Item
http://wiki.hydrogenaud.io/index.php?title=APE_Tags_Header
http://blog.csdn.net/yu_yuan_1314/article/details/13769859