MP3的一些资料

只知道这个描述语言不是JAVA、C,是什么不知道,但大概就是这个样子,没啥难度。

ID3v1 Tags

## 因为 ID3v2 比较复杂,连FOOBAR都不支持它,我想写的东西也就不支持算了,免得麻烦
## 怎么感觉这里不是这样呢,上次看到的是 ID3v1 是在文件的头部的,用UE打开MP3好像也是在头部
The ID3v1 tag is found at the end of an MP3 file and has a fixed number of fields and size. The structure of the tag is as follows:

Private Type MP3ID3V1Tag
  Tag As String * 3           '-- 03 = "TAG"
  Title As String * 30        '-- 33
  Artist As String * 30       '-- 63
  Album As String * 30        '-- 93
  Year As String * 4          '-- 97
  Comment As String * 30      '-- 127
  Genre As Byte               '-- 128
End Type

Note that v1.1 of the ID3v1 specification allows the last two bytes of the Comment tag to be used to store the track number. Byte 29 is always set to 0 in this case, and Byte 30 stores the track number itself.

Checking if an MP3 file contains an ID3v1 tag is a simple matter of rewinding 128 bytes from the end and checking if the bytes read "TAG". If they do, then the rest of the bytes are the tag itself. Reading and writing the tag is simple: if its already there, then you just fill in the structure and then write it over the last 128 bytes of the file. If the tag isn't there, then just append a structure to the end of the file.

###  下面的资料是在这个地方找的,http://www.dv.co.yu/mpgscript/mpeghdr.htm,更多资料可以要查看

MPEG Audio Tag ID3v1

  • The TAG is used to describe the MPEG Audio file. It contains information about artist, title, album, publishing year and genre. There is some extra space for comments. It is exactly 128 bytes long and is located at very end of the audio data. You can get it by reading the last 128 bytes of the MPEG audio file.


    ## 在昨天写的那个程序中,如果把读进来的 String tag 都打印出来的话,可以看到一些效果,当然,那些东西是复制不出来的,只可以自己运行出来看

    AAABBBBB BBBBBBBB BBBBBBBB BBBBBBBB
    BCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCD
    DDDDDDDD DDDDDDDD DDDDDDDD DDDDDEEE
    EFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFG

    Sign

    Length
    (bytes)
    Position
    (bytes)
    Description
    A3(0-2)Tag identification. Must contain 'TAG' if tag exists and is correct.
    B30(3-32)Title
    C30(33-62)Artist
    D30(63-92)Album
    E4(93-96)Year
    F30(97-126)Comment
    G1(127)Genre

    ## 这里提了,它用的编码与汉字的编码是不一样滴,所以我昨天写的那个程序没拿带中文的标签来做实验,呵呵,需要转换一下
    The specification asks for all fields to be padded with null character (ASCII 0). However, not all applications respect this (an example is WinAmp which pads fields with , ASCII 32).

    There is a small change proposed in ID3v1.1 structure. The last byte of the Comment field may be used to specify the track number of a song in an album. It should contain a null character (ASCII 0) if the information is unknown.

    Genre Bytes

    • 再加一些其它的资料,可能只是比较有利于阅读而以
      Genre is a numeric field which may have one of the following values:
    • 以下内容新添加于2005-08-09
    •  "Blues",   "Classic Rock",  "Country",     "Dance",     "Disco",
       "Funk",   "Grunge",    "Hip-Hop",     "Jazz",     "Metal",
       "New Age",   "Oldies",    "Other",     "Pop",      "R&B",
       "Rap",    "Reggae",    "Rock",     "Techno",     "Industrial",
       "Alternative",  "Ska",     "Death Metal",    "Pranks",     "Soundtrack",
       "Euro-Techno", "Ambient",    "Trip-Hop",    "Vocal",     "Jazz+Funk",
       "Fusion",   "Trance",    "Classical",    "Instrumental",   "Acid",
       "House",   "Game",    "Sound Clip",    "Gospel",     "Noise",
       "AlternRock",  "Bass",    "Soul",     "Punk",     "Space",
       "Meditative",  "Instrumental Pop", "Instrumental Rock",  "Ethnic",     "Gothic",
       "Darkwave",  "Techno-Industrial","Electronic",    "Pop-Folk",    "Eurodance",
       "Dream",   "Southern Rock",  "Comedy",     "Cult",     "Gangsta",
       "Top 40",   "Christian Rap",  "Pop/Funk",    "Jungle",     "Native American",
       "Cabaret",   "New Wave",   "Psychadelic",    "Rave",     "Showtunes",
       "Trailer",  "Lo-Fi",    "Tribal",     "Acid Punk",    "Acid Jazz",
       "Polka",   "Retro",    "Musical",     "Rock & Roll",    "Hard Rock",
       // 以下部分的流派最早是 Winamp 播放器专有的,不过好像现在很多播放器也包含了这些
       "Folk",   "Folk-Rock",   "National Folk",   "Swing",     "Fast Fusion",
       "Bebob",   "Latin",    "Revival",     "Celtic",     "Bluegrass",
       "Avantgarde",  "Gothic Rock",   "Progressive Rock",  "Psychedelic Rock",  "Symphonic Rock",
       "Slow Rock",  "Big Band",   "Chorus",     "Easy Listening",   "Acoustic",
       "Humour",   "Speech",    "Chanson",     "Opera",     "Chamber Music",
       "Sonata",   "Symphony",   "Booty Brass",    "Primus",     "Porn Groove",
       "Satire",   "Slow Jam",   "Club",     "Tango",     "Samba",
       "Folklore",  "Ballad",    "Power Ballad",   "Rhythmic Soul",   "Freestyle",
       "Duet",   "Punk Rock",   "Drum Solo",    "A Capela",    "Euro-House",
       "Dance Hall"
    • 这是所有的流派,即 Genre ,在 MP3 的 ID3v1 Tag 中,只是以一个数字代表流派的,所以做一个 MP3 的封装,少不了要加个个性流派的功能,在这里也补上此资料。
    • 今天去图书馆看关于音频的书,讲的都是编码、压缩的东西,目前看来,我是用不上的。

    PS于2005-08-12 05:55
    再贴两篇好文章进来:地址1地址2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值