FLV audio tag
2019獨角獸企業重金招聘Python工程師標準>>>
Adobe Flash Video File Format Specification Version 10.1?
File Tag包括Tag Header和Tag Data兩部分。不同類型的Tag的Header結構是相同的,但是Data結構各不相同
File Tag Header數據。
????當前版本的Tag Header結構占用11個字節,如上圖綠色部分所示:
????第1個字節表示Tag類型,包括音頻(0x08)、視頻(0x09)和script data(0x12),其他類型值被保留。? 即為0x08
????第2-4字節為UI24類型的值,表示該Tag Data部分的大小。 即為0x0C=12
????第5-7字節為UI24類型的值,表示該Tag的時間戳(單位為ms),第一個Tag的時間戳總是0。即為0x74=116,此時間戳表示解碼時間!!!
????第8個字節為時間戳的擴展字節,當24位數值不夠時,該字節作為最高位將時間戳擴展為32位值。? 即為0x00
????第9-11字節為UI24類型的值,表示stream id,總是0. 即為0x00
Audio Tag Header數據:
- 第一個字節中的前4個bit表示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編碼
- 第一個字節中第5和6 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,即為立體聲
?
轉載于:https://my.oschina.net/u/2326611/blog/679704
總結
以上是生活随笔為你收集整理的FLV audio tag的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于C语言中运算符优先级的一次错误
- 下一篇: 字符串查找KMP算法(转)