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,即爲立體聲

相關文章
相關標籤/搜索