FLV audio tag

Adobe Flash Video File Format Specification Version 10.1 ide

File Tag包括Tag HeaderTag Data两部分。不一样类型的TagHeader结构是相同的,可是Data结构各不相同编码

File Tag Header数据。spa

    当前版本的Tag Header结构占用11个字节,如上图绿色部分所示:code

    1个字节表示Tag类型,包括音频(0x08)、视频(0x09)和script data0x12),其余类型值被保留。  即为0x08orm

    2-4字节为UI24类型的值,表示该Tag Data部分的大小。 即为0x0C=12视频

    5-7字节为UI24类型的值,表示该Tag的时间戳(单位为ms),第一个Tag的时间戳老是0即为0x74=116,此时间戳表示解码时间!!!ip

    第8个字节为时间戳的扩展字节,当24位数值不够时,该字节做为最高位将时间戳扩展为32位值。  即为0x00ci

    第9-11字节为UI24类型的值,表示stream id,老是0. 即为0x00it

Audio Tag Header数据:io

  • 第一个字节中的前4bit表示SoundFormat,即编码格式。

Format of SoundData. The following values are defined:

0 = Linear PCM, platform endian

1 = ADPCM

2 = MP3

3 = Linear PCM, little endian

4 = Nellymoser 16 kHz mono

5 = Nellymoser 8 kHz mono

6 = Nellymoser

7 = G.711 A-law logarithmic PCM

8 = G.711 mu-law logarithmic PCM

9 = reserved

10 = AAC

11 = Speex

14 = MP3 8 kHz

15 = Device-specific sound

Formats 7, 8, 14, and 15 are reserved.

AAC is supported in Flash Player 9,0,115,0 and higher.

Speex is supported in Flash Player 10 and higher.

上图中值为0xA,即音频为AAC编码

  • 第一个字节中第56 bit表示SoundRate,即采样率

Sampling rate. The following values are defined:

0 = 5.5 kHz

1 = 11 kHz

2 = 22 kHz

3 = 44 kHz

上图中值为3,即采样率为44kHz

  • 第一个字节中第7bit表示SoundSize,即采样点的大小

Size of each audio sample. This parameter only pertains to

uncompressed formats. Compressed formats always decode

to 16 bits internally.

0 = 8-bit samples

1 = 16-bit samples

上图中值为1,即16 bit采样

  • 第一个字节中第8bit表示SoundType,即声音类型

Mono or stereo sound

0 = Mono sound

1 = Stereo sound

上图中值为1,即为立体声

相关文章
相关标签/搜索