常见音频格式有 mp3, flac, wav, aac 等。下面以一种有损压缩(MP3)、一种无损压缩(FLAC)为例,了解音频文件格式。

MP3

mp3 是一种有损音频文件压缩格式,压缩后大概是 1/10 CD的大小。主要原理是去掉了一些人类比较难识别出来的声音,由于会去掉数据源的这些数据,所以称为有损压缩。mp3 的最高比率是 320kbit/s。

音频文件中 id3 信息是非正式支持的,一般会添加到MP3文件最前面或者最后面,一般解码器解码的时候会忽略掉 ID3 信息。

MP3文件的格式文档:MPEG AUDIO FRAME HEADER

一个 MP3 文件格式如下:

FLAC

FLAC文件格式文档:FLAC - format

一个 FLAC 文件格式如下:

阅读更多:

维基百科音频格式条目:https://en.wikipedia.org/wiki/Audio_file_format

M4A

M4A was generally intended as the successor to MP3

M4A stands for MPEG 4 Audio

AAC or M4A file quality is better and file sizes smaller compared to MP3 files

Audio-only MPEG 4 container files usually have an M4A file extension.

Like most modern container formats, it allows streaming over the Internet.

M4A stands for MPEG 4 Audio and is a filename extension used to represent audio files.

MP4 只是个容器,可以装 audio、video、subtitle 等内容。所以 apple 使用了 m4a 来区分。

In an MPEG-4 file, the AAC data is broken up into a series of variable length frames.

An AAC frame is comprised of blocks called syntax elements. Read the first 3 bits from the frame's bitstream to find the first element type. Decode the element. Proceed to read the first 3 bits of the next element and repeat the decoding process until the frame is depleted.

results matching ""

    No results matching ""