日期:2011-06-23  浏览次数:20409 次

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.

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

SignLength
(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 <space>, ASCII 32).

There is a small change proposed in MP3v1.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 is a numeric field which may have one of the following values:

0'Blues'20'Alternative'40'AlternRock'60'Top 40'
1'Classic Rock'21'Ska'41'Bass'61'Christian Rap'
2'Country'22'Death Metal'42'Soul'62'Pop/Funk'
3'Dance'23'Pranks'43'Punk'63'Jungle'
4'Disco'24'Soundtrack'44'Space'64'Native American'
5'Funk'25'Euro-Techno'45'Meditative'65'Cabaret'
6'Grunge'26'Ambient'46'Instrumental Pop'66'New Wave'
7'Hip-Hop'27'Trip-Hop'47'Instrumental Rock'67'Psychadelic'
8'Jazz'28'Vocal'48'Ethnic'68'Rave'
9'Metal'29'Jazz+Funk'49'Gothic'69'Showtunes'
10'New Age'30'Fusion'50'Darkwave'70'Trailer'
11'Oldies'31'Trance'51'Techno-Industrial'71'Lo-Fi'
12'Other'32'Classical'52'Electronic'72'Tribal'
13'Pop'33'Instrumental'53'Pop-Folk'73'Acid Punk'
14'R&B'34'Acid'54'Eurodance'74'Acid Jazz'
15'Rap'35'House'55'Dream'75'Polka'
16'Reggae'36'Game'56'Southern Rock'76'Retr