The MPEG audio file uses the tag area to describe the relevant information of the audio file, such as the singer, album, release year, music name, genre, audio track, and additional information.
The tag mentioned here is for ID3 V1, including V1.0 and V1.1. In the version definition of ID3 V1, the tag information is defined as follows:
It is stored at the end of the MP3 file and occupies 128 bytes. When the content is insufficient, null (ASCII = 0) or space (ASCII = 32) is used for filling.
The allocation of these 128 bytes is as follows:
- First 3 bytes (0-2): storedTagIf these three characters are not tags, the mpeg file does not contain the correct tag information and will not be processed.
- (3-32) 30 bytes for storing the title of the music)
- 30 bytes (33-62), which are used for singing/playing, artist
- (63-92) 30 bytes for storing the album name
- (93-96), which stores four bytes of the release year.
- (97-126) 30 bytes, which should be divided into situations: V1.0: storing comments/Additional/remarks; V1.1: the first 29 bytes are used to store comments/Additional/remarks, and the last byte is used to store audio track information.
- The last byte (127) stores the genre. Currently, there are 80 basic genre information and 68 extended genre information.
Basic genre Sequence:
0 |
'Blues' |
20 |
& Apos; Alternative & apos' |
40 |
'Alternrock' |
60 |
'Top 40' |
1 |
'Classic rock' |
21 |
'Sks' |
41 |
'Bass' |
61 |
'Christian reac' |
2 |
'Country' |
22 |
'Destath metal' |
42 |
'Soul' |
62 |
'Pop/funk' |
3 |
'Dance' |
23 |
'Prank' |
43 |
'Punk' |
63 |
'Jungl' |
4 |
'Disco' |
24 |
'Soundtrack' |
44 |
'Space' |
64 |
'Native American' |
5 |
'Funk' |
25 |
'Euro-techno' |
45 |
'Meditmode' |
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 |
'Ethenice' |
68 |
'Rdav' |
9 |
'Metal' |
29 |
'Jazz + funk' |
49 |
'Gothic' |
69 |
'Showinstances' |
10 |
'New age' |
30 |
'Fusion' |
50 |
'Dark' |
70 |
'Trailer' |
11 |
'Oldies' |
31 |
'Trance' |
51 |
'Techno-industrial' |
71 |
'Lo-fi' |
12 |
'Other' |
32 |
'Classical' |
52 |
'Electroenice' |
72 |
'Trigger' |
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 |
'Retro' |
17 |
'Rock' |
37 |
'Sound clip' |
57 |
'Comedy' |
77 |
'Musical' |
18 |
'Techno' |
38 |
'Gospel' |
58 |
'Cresult' |
78 |
'Rock & roll' |
19 |
'Industrial' |
39 |
'Noise' |
59 |
'Giangst' |
79 |
'Hard rock' |
I will omit the extension...
With the preparation of the above materials, we will start the work:
The code will not be pasted. It is relatively simple. It is a byte read and, if you are interested, download the source code directly.
Download complete source code
Original article: http://www.zu14.cn/2009/01/11/csharp-mp3-tag-id3v1/