FLV audio tag

Adobe Flash Video File Format Specification Version 10.1 

File Tag包括Tag HeaderTag Data两部分。不同类型的TagHeader结构是相同的,但是Data结构各不相同

102745_dr2k_2326611.png

File Tag Header数据。

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

    1个字节表示Tag类型,包括音频(0x08)、视频(0x09)和script data0x12),其他类型值被保留。  即为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

102846_NZkp_2326611.png

Audio Tag Header数据:

  • 第一个字节中的前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,即为立体声

 

转载于:https://my.oschina.net/u/2326611/blog/679704

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值