以下是 ID3-Tag 的有关资料 *************************ID3-Tag format (WinAmp style) =============================This structure can be appended to mp3 files and provide information about the track which can be viewed using WinAmp or other mp3 player.struct idtag { const char magic[3] = "TAG"; char title[30]; char artist[30]; char album[30]; char year[4]; char comment[30]; char genre; }; Own database format ===================Text file, lines are separated by or , fields are separated by (ASCII 9). You can produce these tables easily with most spreadsheet programs, with awk/perl/c-programs or with a text editor.First line : "PUMPDB 1.0" (Magic)Other lines have the following fields: path, title, artist, album, year, comment, genre, priorityMaximum string length for the individual entries: path : 128 title : 64 artist : 64 album : 64 year : 4 (only digits from 0 to 9) comment : 64 genre : 20 (see Section "Genre") priority: 3 (only digits from 0 to 9) emphasis: 3 ( " )Res to the database format ==============================The format is designed to make it easyer to handle MP3 files stored on a CD-ROM in ISO9660 format, which does not support long file names. The idea is to put a file called "PUMP.DB" in the root directory of every CD-ROM containing MP3 files which contains consecutive entries of the dbentry structure.You may omit any of the fields except the field. If you provide fields after omitted fields, you will have to provide the correct number of s. The fist non-empty field in a line is taken as the path, so you can (and _should_) not omit the path field. path: This field contains a string of the file name of the MP3 file with the complete path relative to the location of the PUMP.DB file. 128 characters are sufficient because the (strict) ISO format only allows file and directory names to consist of 8 characters a, dot (".") and another 3 characters and the maximum directory depth is 8. That makes 9 x (8 + 1 + 3) = 108 bytes. How this field is handeled depends on the software reading it, but it is recommended to stick the following rules: - Do not use long file or directory names, just use 8.3 DOS conforming names. Some CD-ROMs and all modern file systems provide support for long file names (ISO extensions, Joliet, VFAT, ...) - resist to write them to the PUMP.DB. - Use uppercase letters only. - Do not use any special characters like spaces or "%". Characters to use are: "A" - "Z", "0" - "9", "_" and "~". - Use "/" as directory separator, not "\". - Let entries begin with a valid directory or file name. Entries that begin with "/", "./" or "../" might not be processed properly. An Example: Suppose your CD drive had the drive letter E: and there was a directory in the root directory called "No_Doubt_-_Tragic_Kingdom" and in this directory was a file called "No_Doubt_-_Don't_speak.mp3" then you would normally access this file with something like "E:\No_Doubt_-_Tragic_Kingdom\No_Doubt_-_Don't_speak.mp3" Obeying the above rules, you'd have to find out the real ISO file names before writing an entry in the PUMP.DB. Suppose the ISO name of the directory would be "NO_DOU~1" and the file name "NO_DO~11.MP3". Then a correct entry would look like: "NO_DOU~1/NO_DO~11.MP3" (without the quotes)ATTENTION! Normally, you would use a tool that generates the PUMP.DB entries for you automatically. This can lead to problems because CD writing software does not necessarily use the same names for the ISO file names that DOS uses when the files are on a hard disk. Make sure you know how the files will be named on the resulting CD! In some CD writing software you can check the ISO file names before writing. In other software you could at least guess how the files will be named. Some software does use the exact DOS file names (CDRWIN from Golden Hawk and WinOnCD from CeQuadrat do), other software has a different numbering scheme for the numbers following the "~" and some software replaces the "~" with "_" (underscore). The coolest way to be sure is to build an ISO image and use linux to check the file names. Mount the ISO image via the loopback device and keep linux from using joliet file names. title: The title (name) of the song. Experiences have proven that 30 characters are not sufficient for names like "This great track (crazy mpeg layer 3 remix)". artist: The interpret of the track. Again, 30 characters are too small for names like: "This great artist featuring another great artist" album: The name of the album the MP3s were ripped from. year: The year of publishing of the tracks. Only numeric entries with 4 digits - we do not want to have another Y2000 prob ;) comment: Any comments you might want to associate with the file. genre: A string describing the genre the track belongs to. It is a good idea to choose a genre name that appears in the section "Genres". priority: A string describing the priority assiciated with the track. This information can be used for search functions or the propability a MP3-player plays this track when playing files randomly. Normal priority is "127". Higher values mean higher priority.emphasis: This is an offset to the volume setting of an MP3-Player. You can use this to compensate for poorly sampled MP3 songs. 127 means normal volume, 255 is maximal, 0 is minimal volume. Genres ======You can ignore the hexadecimal id, for the database format, only the genre name is needed. The list contains the genres used by WinAmp 2.03.
hex description00 Blues 01 Classic 02 Country 03 Dance 04 Disco 05 Funk 06 Grunge 07 Hip-Hop 08 Jazz 09 Metal 0a New 0b Oldies 0c Other 0d Pop 0e R&B 0f Rap 10 Reggae 11 Rock 12 Techno 13 Industrial 14 Alternative 15 Ska 16 Death 17 Pranks 18 Soundtrack 19 Euro-Techno 1a Ambient 1b Trip-Hop 1c Vocal 1d Jazz+Funk 1e Fusion 1f Trance 20 Classical 21 Instrumental 22 Acid 23 House 24 Game 25 Sound 26 Gospel 27 Noise 28 Alt. 29 Bass 2a Soul 2b Punk 2c Space 2d Meditative 2e Instrumental Pop 2f Instrumental Rock 30 Ethnic 31 Gothic 32 Darkwave 33 Techno-Industrial 34 Electronic 35 Pop-Folk 36 Euro 37 Dream 38 Southern 39 Comedy 3a Cult 3b Gangsta Rap 3c Top 3d Christian 3e Pop/Funk 3f Jungle 40 Native 41 Cabaret 42 New 43 Psychedelic 44 Rave 45 Show 46 Trailer 47 Lo-Fi 48 Tribal 49 Acid Punk 4a Acid Jazz 4b Polka 4c Retro 4d Musical 4e Rock 4f Hard 50 Folk 51 Folk/Rock 52 National 53 Swing 54 Fast-Fusion 55 Bebob 56 Latin 57 Revival 58 Celtic 59 Bluegrass 5a Avantgarde 5b Gothic 5c Progressive 5d Psychedelic 5e Symphonic 5f Slow 60 Big 61 Chorus 62 Easy 63 Acoustic 64 Humour 65 Speech 66 Chanson 67 Opera 68 Chamber 69 Sonata 6a Symphony 6b Booty 6c Primus 6d Porn 6e Satire 6f Slow 70 Club 71 Tango 72 Samba 73 Folklore 74 Ballad 75 Power 76 Rhythmic Soul 77 Free 78 Duet 79 Punk 7a Drum 7b Acapella 7c Euro-House 7d Dance 7e Goa 7f Drum 80 Club-House 81 Hardcore 82 Terror 83 Indie 84 Britpop 85 Negerpunk 86 Polsk Punk 87 Beat 88 Christian Gangsta 89 Heavy Metal 8a Black Metal 8b Crossover 8c Contemporary Ch? 8d Christian Rock 8e Merengue 8f Salsa 90 Trash Metal 91 Anime 92 JPop 93 Synthpop
多谢
{
HRESULT hr;
double MovieDuration ;
IGraphBuilder *pigb;
IMediaPosition *pims = NULL; CoInitialize(NULL);
hr = CoCreateInstance(CLSID_FilterGraph, // get this documents graph object
NULL,
CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,
(void **) &pigb); if (FAILED(hr)) return -1; WCHAR wFile[512];
MultiByteToWideChar( CP_ACP, 0, (LPCSTR)sMovieName, -1, wFile, 512 );
hr = pigb->RenderFile(wFile, NULL);
pigb->QueryInterface(IID_IMediaPosition, (void **)&pims);
pims->get_Duration(&MovieDuration);
pims->Release();
pigb->Release();
CoUninitialize(); return (float)MovieDuration ;
}
typedef struct {
char tag[3];
char title[30];
char artist[30];
char album[30];
char year[4];
char comments[30];
char genre;
}MP3_TAILER;
*************************ID3-Tag format (WinAmp style)
=============================This structure can be appended to mp3 files and provide information
about the track which can be viewed using WinAmp or other mp3 player.struct idtag {
const char magic[3] = "TAG";
char title[30];
char artist[30];
char album[30];
char year[4];
char comment[30];
char genre;
};
Own database format
===================Text file, lines are separated by or , fields are
separated by (ASCII 9). You can produce these tables
easily with most spreadsheet programs, with awk/perl/c-programs
or with a text editor.First line : "PUMPDB 1.0" (Magic)Other lines have the following fields: path, title, artist, album, year, comment, genre, priorityMaximum string length for the individual entries:
path : 128
title : 64
artist : 64
album : 64
year : 4 (only digits from 0 to 9)
comment : 64
genre : 20 (see Section "Genre")
priority: 3 (only digits from 0 to 9)
emphasis: 3 ( " )Res to the database format
==============================The format is designed to make it easyer to handle MP3 files stored on a
CD-ROM in ISO9660 format, which does not support long file names. The
idea is to put a file called "PUMP.DB" in the root directory of every
CD-ROM containing MP3 files which contains consecutive entries of the
dbentry structure.You may omit any of the fields except the field. If you provide
fields after omitted fields, you will have to provide the correct number
of s. The fist non-empty field in a line is taken as the path, so
you can (and _should_) not omit the path field.
path: This field contains a string of the file name of the MP3 file
with the complete path relative to the location of the PUMP.DB
file. 128 characters
are sufficient because the (strict) ISO format only allows file
and directory names to consist of 8 characters a, dot (".") and
another 3 characters and the maximum directory depth is 8. That
makes 9 x (8 + 1 + 3) = 108 bytes.
How this field is handeled depends on the software reading it,
but it is recommended to stick the following rules: - Do not use long file or directory names, just use 8.3 DOS
conforming names. Some CD-ROMs and all modern file systems
provide support for long file names (ISO extensions, Joliet,
VFAT, ...) - resist to write them to the PUMP.DB. - Use uppercase letters only. - Do not use any special characters like spaces or "%".
Characters to use are: "A" - "Z", "0" - "9", "_" and "~". - Use "/" as directory separator, not "\". - Let entries begin with a valid directory or file name.
Entries that begin with "/", "./" or "../" might not be
processed properly. An Example:
Suppose your CD drive had the drive letter E: and there
was a directory in the root directory called
"No_Doubt_-_Tragic_Kingdom"
and in this directory was a file called
"No_Doubt_-_Don't_speak.mp3"
then you would normally access this file with something like
"E:\No_Doubt_-_Tragic_Kingdom\No_Doubt_-_Don't_speak.mp3"
Obeying the above rules, you'd have to find out the real ISO
file names before writing an entry in the PUMP.DB.
Suppose the ISO name of the directory would be "NO_DOU~1"
and the file name "NO_DO~11.MP3". Then a correct entry would
look like:
"NO_DOU~1/NO_DO~11.MP3" (without the quotes)ATTENTION! Normally, you would use a tool that generates the PUMP.DB
entries for you automatically. This can lead to problems because CD
writing software does not necessarily use the same names for the ISO
file names that DOS uses when the files are on a hard disk. Make sure
you know how the files will be named on the resulting CD! In some CD
writing software you can check the ISO file names before writing. In
other software you could at least guess how the files will be named.
Some software does use the exact DOS file names (CDRWIN from Golden
Hawk and WinOnCD from CeQuadrat do), other software has a different
numbering scheme for the numbers following the "~" and some software
replaces the "~" with "_" (underscore).
The coolest way to be sure is to build an ISO image and use linux to
check the file names. Mount the ISO image via the loopback device and
keep linux from using joliet file names.
title: The title (name) of the song. Experiences have proven that 30
characters are not sufficient for names like
"This great track (crazy mpeg layer 3 remix)".
artist: The interpret of the track. Again, 30 characters are too small
for names like:
"This great artist featuring another great artist"
album: The name of the album the MP3s were ripped from.
year: The year of publishing of the tracks. Only numeric entries
with 4 digits - we do not want to have another Y2000 prob ;)
comment: Any comments you might want to associate with the file.
genre: A string describing the genre the track belongs to. It is a
good idea to choose a genre name that appears in the section
"Genres".
priority: A string describing the priority assiciated with the track.
This information can be used for search functions or the
propability a MP3-player plays this track when playing files
randomly. Normal priority is "127". Higher values mean higher
priority.emphasis: This is an offset to the volume setting of an MP3-Player.
You can use this to compensate for poorly sampled MP3 songs.
127 means normal volume, 255 is maximal, 0 is minimal volume.
Genres
======You can ignore the hexadecimal id, for the database format, only the
genre name is needed. The list contains the genres used by WinAmp 2.03.
01 Classic
02 Country
03 Dance
04 Disco
05 Funk
06 Grunge
07 Hip-Hop
08 Jazz
09 Metal
0a New
0b Oldies
0c Other
0d Pop
0e R&B
0f Rap
10 Reggae
11 Rock
12 Techno
13 Industrial
14 Alternative
15 Ska
16 Death
17 Pranks
18 Soundtrack
19 Euro-Techno
1a Ambient
1b Trip-Hop
1c Vocal
1d Jazz+Funk
1e Fusion
1f Trance
20 Classical
21 Instrumental
22 Acid
23 House
24 Game
25 Sound
26 Gospel
27 Noise
28 Alt.
29 Bass
2a Soul
2b Punk
2c Space
2d Meditative
2e Instrumental Pop
2f Instrumental Rock
30 Ethnic
31 Gothic
32 Darkwave
33 Techno-Industrial
34 Electronic
35 Pop-Folk
36 Euro
37 Dream
38 Southern
39 Comedy
3a Cult
3b Gangsta Rap
3c Top
3d Christian
3e Pop/Funk
3f Jungle
40 Native
41 Cabaret
42 New
43 Psychedelic
44 Rave
45 Show
46 Trailer
47 Lo-Fi
48 Tribal
49 Acid Punk
4a Acid Jazz
4b Polka
4c Retro
4d Musical
4e Rock
4f Hard
50 Folk
51 Folk/Rock
52 National
53 Swing
54 Fast-Fusion
55 Bebob
56 Latin
57 Revival
58 Celtic
59 Bluegrass
5a Avantgarde
5b Gothic
5c Progressive
5d Psychedelic
5e Symphonic
5f Slow
60 Big
61 Chorus
62 Easy
63 Acoustic
64 Humour
65 Speech
66 Chanson
67 Opera
68 Chamber
69 Sonata
6a Symphony
6b Booty
6c Primus
6d Porn
6e Satire
6f Slow
70 Club
71 Tango
72 Samba
73 Folklore
74 Ballad
75 Power
76 Rhythmic Soul
77 Free
78 Duet
79 Punk
7a Drum
7b Acapella
7c Euro-House
7d Dance
7e Goa
7f Drum
80 Club-House
81 Hardcore
82 Terror
83 Indie
84 Britpop
85 Negerpunk
86 Polsk Punk
87 Beat
88 Christian Gangsta
89 Heavy Metal
8a Black Metal
8b Crossover
8c Contemporary Ch?
8d Christian Rock
8e Merengue
8f Salsa
90 Trash Metal
91 Anime
92 JPop
93 Synthpop