id3 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.html +146 -0
- data/README +23 -0
- data/docs/Class_AudioFile.html +110 -0
- data/docs/Class_Frame.html +125 -0
- data/docs/Class_Tag1.html +121 -0
- data/docs/Class_Tag2.html +167 -0
- data/docs/ID3-Standards/id3v2-00.html +1669 -0
- data/docs/ID3-Standards/id3v2-00.txt +1660 -0
- data/docs/ID3-Standards/id3v2.3.0.html +2033 -0
- data/docs/ID3-Standards/id3v2.3.0.txt +2025 -0
- data/docs/ID3-Standards/id3v2.4.0-changes.html +159 -0
- data/docs/ID3-Standards/id3v2.4.0-changes.txt +149 -0
- data/docs/ID3-Standards/id3v2.4.0-frames.html +1743 -0
- data/docs/ID3-Standards/id3v2.4.0-frames.txt +1732 -0
- data/docs/ID3-Standards/id3v2.4.0-structure.html +742 -0
- data/docs/ID3-Standards/id3v2.4.0-structure.txt +732 -0
- data/docs/ID3_comparison.html +2121 -0
- data/docs/ID3_comparison2.html +2043 -0
- data/docs/ID3v2_frames_comparison.html +2121 -0
- data/docs/ID3v2_frames_comparison.txt +197 -0
- data/docs/ID3v2_frames_overview.txt +60 -0
- data/docs/Module_ID3.html +146 -0
- data/docs/id3.html +245 -0
- data/docs/index.html +252 -0
- data/index.html +8 -0
- data/lib/hexdump.rb +113 -0
- data/lib/id3.rb +1177 -0
- data/lib/invert_hash.rb +105 -0
- metadata +75 -0
data/LICENSE.html
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
<!doctype HTML public "-//W3O//DTD W3 HTML 3.2//EN">
|
2
|
+
<HTML>
|
3
|
+
<HEAD>
|
4
|
+
<TITLE>The Artistic License</TITLE>
|
5
|
+
</HEAD>
|
6
|
+
<BODY TEXT="#000000" BACKGROUND="osbak.png" BGCOLOR="#FFFFFF">
|
7
|
+
<TABLE WIDTH=100% HEIGHT=100% cellpadding=0 border=0>
|
8
|
+
<tr>
|
9
|
+
<td width=50 valign=top align=left>
|
10
|
+
<IMG src="osside.png">
|
11
|
+
</td>
|
12
|
+
<td>
|
13
|
+
|
14
|
+
<H1 ALIGN=CENTER><FONT COLOR=#ff0000>Artistic License plus Addendum A</FONT></H1>
|
15
|
+
|
16
|
+
<center>The "Artistic License"</center><p>
|
17
|
+
<center>Preamble</center><p>
|
18
|
+
|
19
|
+
The intent of this document is to state the conditions under which a
|
20
|
+
Package may be copied, such that the Copyright Holder maintains some
|
21
|
+
semblance of artistic control over the development of the package,
|
22
|
+
while giving the users of the package the right to use and distribute
|
23
|
+
the Package in a more-or-less customary fashion, plus the right to make
|
24
|
+
reasonable modifications.<p>
|
25
|
+
|
26
|
+
Definitions:<P>
|
27
|
+
|
28
|
+
<UL>
|
29
|
+
<LI> "Package" refers to the collection of files distributed by the
|
30
|
+
Copyright Holder, and derivatives of that collection of files
|
31
|
+
created through textual modification.<P>
|
32
|
+
|
33
|
+
<LI> "Standard Version" refers to such a Package if it has not been
|
34
|
+
modified, or has been modified in accordance with the wishes
|
35
|
+
of the Copyright Holder.<P>
|
36
|
+
|
37
|
+
<LI> "Copyright Holder" is whoever is named in the copyright or
|
38
|
+
copyrights for the package.<P>
|
39
|
+
|
40
|
+
<LI> "You" is you, if you're thinking about copying or distributing
|
41
|
+
this Package.<P>
|
42
|
+
|
43
|
+
<LI> "Reasonable copying fee" is whatever you can justify on the
|
44
|
+
basis of media cost, duplication charges, time of people involved,
|
45
|
+
and so on. (You will not be required to justify it to the
|
46
|
+
Copyright Holder, but only to the computing community at large
|
47
|
+
as a market that must bear the fee.)<P>
|
48
|
+
|
49
|
+
<LI> "Freely Available" means that no fee is charged for the item
|
50
|
+
itself, though there may be fees involved in handling the item.
|
51
|
+
It also means that recipients of the item may redistribute it
|
52
|
+
under the same conditions they received it.<P>
|
53
|
+
</UL>
|
54
|
+
|
55
|
+
1. You may make and give away verbatim copies of the source form of the
|
56
|
+
Standard Version of this Package without restriction, provided that you
|
57
|
+
duplicate all of the original copyright notices and associated disclaimers.<P>
|
58
|
+
|
59
|
+
2. You may apply bug fixes, portability fixes and other modifications
|
60
|
+
derived from the Public Domain or from the Copyright Holder. A Package
|
61
|
+
modified in such a way shall still be considered the Standard Version.<P>
|
62
|
+
|
63
|
+
3. You may otherwise modify your copy of this Package in any way, provided
|
64
|
+
that you insert a prominent notice in each changed file stating how and
|
65
|
+
when you changed that file, and provided that you do at least ONE of the
|
66
|
+
following:<P>
|
67
|
+
|
68
|
+
<BLOCKQUOTE>
|
69
|
+
a) place your modifications in the Public Domain or otherwise make them
|
70
|
+
Freely Available, such as by posting said modifications to Usenet or
|
71
|
+
an equivalent medium, or placing the modifications on a major archive
|
72
|
+
site such as ftp.uu.net, or by allowing the Copyright Holder to include
|
73
|
+
your modifications in the Standard Version of the Package.<P>
|
74
|
+
|
75
|
+
b) use the modified Package only within your corporation or organization.<P>
|
76
|
+
|
77
|
+
c) rename any non-standard executables so the names do not conflict
|
78
|
+
with standard executables, which must also be provided, and provide
|
79
|
+
a separate manual page for each non-standard executable that clearly
|
80
|
+
documents how it differs from the Standard Version.<P>
|
81
|
+
|
82
|
+
d) make other distribution arrangements with the Copyright Holder.<P>
|
83
|
+
</BLOCKQUOTE>
|
84
|
+
|
85
|
+
4. You may distribute the programs of this Package in object code or
|
86
|
+
executable form, provided that you do at least ONE of the following:<P>
|
87
|
+
|
88
|
+
<BLOCKQUOTE>
|
89
|
+
a) distribute a Standard Version of the executables and library files,
|
90
|
+
together with instructions (in the manual page or equivalent) on where
|
91
|
+
to get the Standard Version.<P>
|
92
|
+
|
93
|
+
b) accompany the distribution with the machine-readable source of
|
94
|
+
the Package with your modifications.<P>
|
95
|
+
|
96
|
+
c) accompany any non-standard executables with their corresponding
|
97
|
+
Standard Version executables, giving the non-standard executables
|
98
|
+
non-standard names, and clearly documenting the differences in manual
|
99
|
+
pages (or equivalent), together with instructions on where to get
|
100
|
+
the Standard Version.<P>
|
101
|
+
|
102
|
+
d) make other distribution arrangements with the Copyright Holder.<P>
|
103
|
+
</BLOCKQUOTE>
|
104
|
+
|
105
|
+
5. You may charge a reasonable copying fee for any distribution of this
|
106
|
+
Package. You may charge any fee you choose for support of this Package.
|
107
|
+
You may not charge a fee for this Package itself. However,
|
108
|
+
you may distribute this Package in aggregate with other (possibly
|
109
|
+
commercial) programs as part of a larger (possibly commercial) software
|
110
|
+
distribution provided that you do not advertise this Package as a
|
111
|
+
product of your own.<P>
|
112
|
+
|
113
|
+
6. The scripts and library files supplied as input to or produced as
|
114
|
+
output from the programs of this Package do not automatically fall
|
115
|
+
under the copyright of this Package, but belong to whomever generated
|
116
|
+
them, and may be sold commercially, and may be aggregated with this
|
117
|
+
Package.<P>
|
118
|
+
|
119
|
+
7. C or perl subroutines supplied by you and linked into this Package
|
120
|
+
shall not be considered part of this Package.<P>
|
121
|
+
|
122
|
+
8. The name of the Copyright Holder may not be used to endorse or promote
|
123
|
+
products derived from this software without specific prior written permission.<P>
|
124
|
+
|
125
|
+
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
126
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
127
|
+
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.<P>
|
128
|
+
|
129
|
+
<font color=red>
|
130
|
+
Addendum A. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
131
|
+
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
132
|
+
<P>
|
133
|
+
IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
134
|
+
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
|
135
|
+
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR USELESS OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
|
136
|
+
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF THE COPYRIGHT HOLDERS OR OTHER PARTY HAS BEEN ADVISED OF
|
137
|
+
THE POSSIBILITY OF SUCH DAMAGES.
|
138
|
+
</font>
|
139
|
+
|
140
|
+
<center>The End</center>
|
141
|
+
</table>
|
142
|
+
</td>
|
143
|
+
</table>
|
144
|
+
</BODY>
|
145
|
+
</HTML>
|
146
|
+
|
data/README
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
This is a BETA-RELEASE of a native Ruby ID3-library.
|
3
|
+
|
4
|
+
Author: Tilo Sloboda <tools-NOSPAM@unixgods.org>
|
5
|
+
|
6
|
+
Home Page: http://www.unixgods.org/~tilo/Ruby/ID3
|
7
|
+
|
8
|
+
License: http://www.unixgods.org/~tilo/artistic-license.html
|
9
|
+
|
10
|
+
MD5 Sums:
|
11
|
+
|
12
|
+
400ccf29d29da1d203f38657a18fca3e id3-0.4.0.gem
|
13
|
+
0ce2f2e3a2e57aba92ce72ec300ffa76 id3-0.4.0.tar.gz
|
14
|
+
|
15
|
+
|
16
|
+
NOTE:
|
17
|
+
|
18
|
+
This is a beta release.. so, if you think there are some problems,
|
19
|
+
errors, inconsistencies, or there is something missing, please contact
|
20
|
+
the author - THANK YOU! :-)
|
21
|
+
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html><head>
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
7
|
+
<title>Class AudioFile</title>
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
</head><body><br>
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
<br>
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<br>
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<h3>class ID3::AudioFile</h3>
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
ID3-tags can be attached to more than just MP3-files, that's why
|
31
|
+
AudioFile has no knowledge about the MP3-standard. If you want to
|
32
|
+
include it, you can derive your own class and add that functionality.<br>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
<br>
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
<h4>
|
41
|
+
Provided Functionality:
|
42
|
+
</h4>
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
<ul>
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
<li>Reads and parses audio files for ID3-tags</li>
|
52
|
+
<li>Writes audio files and attaches ID3-tags to them</li><li>Keeps track of complete path name to audio file</li><li>Keeps track of where the raw audio portion of an audio-file is<br>
|
53
|
+
</li>
|
54
|
+
|
55
|
+
|
56
|
+
<li>Top-level interface to ID3-tags</li>
|
57
|
+
</ul>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<h4>Instance Variables:</h4>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<ul>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<li>pwd , filename #
|
70
|
+
working directory and path/name of the file when it was opened..</li>
|
71
|
+
<li>dirname, basename # absolute dirname and basename of the file<br>
|
72
|
+
</li>
|
73
|
+
<li>tagID3v1 , tagID3v2 # the ID3-tags , if not present these are nil<br>
|
74
|
+
# should they be renamed to tag1 and tag2 ? <br>
|
75
|
+
</li>
|
76
|
+
</ul>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<br>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<h4>Instance Methods:</h4>
|
85
|
+
|
86
|
+
|
87
|
+
<ul>
|
88
|
+
|
89
|
+
|
90
|
+
<li>new</li>
|
91
|
+
<li>audioMD5sum</li>
|
92
|
+
<li>writeMD5sum</li><li>verifyMD5sum<br>
|
93
|
+
</li>
|
94
|
+
<li>version / versions<br>
|
95
|
+
</li>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
|
99
|
+
|
100
|
+
<br>
|
101
|
+
|
102
|
+
|
103
|
+
<h4>Examples:</h4>
|
104
|
+
|
105
|
+
<pre><br> > a = ID3::AudioFile.new("mp3/a.mp3")<br> => #<ID3::AudioFile:0x402714ec @pwd="/home/tilo/Ruby/ID3", @tagID3v1={"ARTIST"=>"Wolfsheim", "ALBUM"=>"", "TITLE"=>"Sleep Somehow", "YEAR"=>"", "GENREID"=>"255", "COMMENT"=>""}, @audioMD5sum=nil, @filename="mp3/a.mp3", @basename="a.mp3", @audioEndX=1433600, @dirname="/home/tilo/Ruby/ID3/mp3", @audioStartX=1418, @tagID3v2={"ARTIST"=>{"encoding"=>0, "text"=>"Wolfsheim"}, "SONGLEN"=>{"encoding"=>0, "text"=>"193567"}, "CONTENTTYPE"=>{"encoding"=>0, "text"=>"newage"}, "ALBUM"=>{"encoding"=>0, "text"=>"Spectators"}, "TRACKNUM"=>{"encoding"=>0, "text"=>"6"}, "TITLE"=>{"encoding"=>0, "text"=>"Sleep Somehow"}, "MEDIATYPE"=>{"encoding"=>0, "text"=>"DIG"}}><br><br> > a.version<br> => "1.0 2.3.0"<br><br> > a.tagID3v1<br> => {"ARTIST"=>"Wolfsheim", "ALBUM"=>"", "TITLE"=>"Sleep Somehow", "YEAR"=>"", "GENREID"=>"255", "COMMENT"=>""}<br><br> > a.tagID3v2<br> => {"ARTIST"=>{"encoding"=>0, "text"=>"Wolfsheim"}, "SONGLEN"=>{"encoding"=>0, "text"=>"193567"}, "CONTENTTYPE"=>{"encoding"=>0, "text"=>"newage"}, "ALBUM"=>{"encoding"=>0, "text"=>"Spectators"}, "TRACKNUM"=>{"encoding"=>0, "text"=>"6"}, "TITLE"=>{"encoding"=>0, "text"=>"Sleep Somehow"}, "MEDIATYPE"=>{"encoding"=>0, "text"=>"DIG"}}<br><br><br></pre>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
</body></html>
|
@@ -0,0 +1,125 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html><head>
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
7
|
+
<title>Class ID3::Frame</title>
|
8
|
+
|
9
|
+
</head>
|
10
|
+
<body><br>
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
<br>
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
<br>
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
<h3>class ID3::Frame</h3>
|
26
|
+
|
27
|
+
This class models ID3-Frames independent of
|
28
|
+
the D3-version, e.g. 2.2.0, 2.3.0, 2.4.0 This module
|
29
|
+
tries to hide all the ugly details about the Frame-internals and how to
|
30
|
+
parse each Frame-type for each ID3-version.<br>
|
31
|
+
|
32
|
+
|
33
|
+
<br>
|
34
|
+
|
35
|
+
|
36
|
+
The user doesn't need to use any of the methods provided by this
|
37
|
+
module, but s/he can access the Instance Variables to examine each
|
38
|
+
Frame.<br>
|
39
|
+
|
40
|
+
|
41
|
+
<br>
|
42
|
+
|
43
|
+
|
44
|
+
Each Frame is organized as a "ordered Hash" , to preserve the order of it's fields, as they are defined by the ID3-standard<br>
|
45
|
+
|
46
|
+
<br>
|
47
|
+
|
48
|
+
Because the names of the ID3-Frames vary between the ID3-versions, we are using a <a href="ID3_comparison.html">symbolic name to reference the Frame</a>, not it's real (short) name.<br>
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
<h4>
|
53
|
+
Provided Functionality:
|
54
|
+
</h4>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<ul>
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<li>Reads and parses a frame upon initialization<br>
|
64
|
+
</li>
|
65
|
+
<li>Dumps a frame raw into a string</li><li>Low-level interface to ID3-Frames</li>
|
66
|
+
<li>Not all Frame-types are fully parsed, but can be accessed/copied/dumped as raw<br>
|
67
|
+
</li>
|
68
|
+
</ul>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<h4>Instance Variables:</h4>
|
73
|
+
|
74
|
+
|
75
|
+
<ul>
|
76
|
+
|
77
|
+
|
78
|
+
<li>name</li>
|
79
|
+
<li>version</li>
|
80
|
+
<li>raw<br>
|
81
|
+
</li>
|
82
|
+
<li>rawdata</li>
|
83
|
+
<li>rawheader</li>
|
84
|
+
<li>rawflags # if version is larger than 2.2.x</li>
|
85
|
+
<li>flags
|
86
|
+
# Hash with the parsed flags, if version > 2.2.x<br>
|
87
|
+
</li>
|
88
|
+
<li>headerStartX</li>
|
89
|
+
<li>dataStartX</li>
|
90
|
+
</ul>
|
91
|
+
|
92
|
+
|
93
|
+
<br>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<h4>Instance Methods:</h4>
|
99
|
+
|
100
|
+
|
101
|
+
<ul>
|
102
|
+
|
103
|
+
|
104
|
+
<li>initialize
|
105
|
+
# does all the hard work.. parses the Frame, defines parse/dump-methods<br>
|
106
|
+
</li><li>parse
|
107
|
+
# defined during run-time, depending on the particular Frame-Type<br>
|
108
|
+
</li>
|
109
|
+
<li>dump
|
110
|
+
# defined during run-time, depending on the particular Frame-Type<br>
|
111
|
+
</li>
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
<br>
|
115
|
+
|
116
|
+
|
117
|
+
<h4>Examples:</h4>
|
118
|
+
|
119
|
+
|
120
|
+
<pre> > require 'id3'<br> => true<br><br> # here we're just creating an ID3::Tag2 object and read-in an mp3-file<br><br> > t = ID3::Tag2.new<br> => {}<br> > t.read("mp3/b.mp3")<br> => true<br> > t.version<br> => "2.2.0"<br> > t.keys<br> => ["ARTIST", "SONGLEN", "CONTENTTYPE", "ALBUM", "ENCODEDBY", "TRACKNUM", "TITLE", "YEAR", "PICTURE", "MEDIATYPE", "COMMENT"]<br><br> # NOW let's look at the internals of a Frame:<br><br> > t['ARTIST']<br> => {"encoding"=>0, "text"=>"Juno reactor"}<br><br> > t['ARTIST'].keys<br> => ["encoding", "text"]<br><br> > t['ARTIST'].order<br> => ["encoding", "text"]<br><br> # PLEASE NOTE that the author does not have expertise with other than western character encodings..<br> # I'd like to hear some input how this can be implemented better.. and if/how Ruby can detect<br> # the character encoding of a string which was provided by the user<br><br> > t['ARTIST']['text'] = "Juno Reactor"<br> => "Juno Reactor"<br><br> > t['ARTIST'].raw<br> => "TP1\000\000\016\000Juno reactor\000"<br><br> > t['ARTIST'].rawheader<br> => "TP1\000\000\016"<br><br> > t['ARTIST'].rawdata<br> => "\000Juno reactor\000"<br><br> # a lot of the really useful Frame types are text frames..<br><br> > t['CONTENTTYPE']<br> => {"encoding"=>0, "text"=>"Electronica/Dance"}<br><br> > t['YEAR']<br> => {"encoding"=>0, "text"=>"1997"}<br><br> > t['SONGLEN']<br> => {"encoding"=>0, "text"=>"258847"}<br><br><br></pre>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
</body></html>
|
@@ -0,0 +1,121 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html><head>
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
7
|
+
<title>Class ID3::Tag1</title>
|
8
|
+
|
9
|
+
</head>
|
10
|
+
<body><br>
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
<br>
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
<br>
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
<h3>class ID3::Tag1</h3>
|
26
|
+
|
27
|
+
|
28
|
+
This class models version 1.x ID3-tags, and is mostly for backwards
|
29
|
+
compatibility. It's recommended to use version 2.x
|
30
|
+
ID3-tags, because they don't truncate the values, and give more
|
31
|
+
flexibility.<br>
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
<br>
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
<h4>
|
40
|
+
Provided Functionality:
|
41
|
+
</h4>
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
<ul>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
<li>Reads and parses audio files for ID3-tags</li>
|
51
|
+
<li>Writes audio files and attaches ID3-tags to them # not yet implemented<br>
|
52
|
+
</li>
|
53
|
+
|
54
|
+
|
55
|
+
<li>Low-level interface to ID3-tags</li>
|
56
|
+
</ul>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<h4>Instance Variables:</h4>
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<ul>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<li>version # either nil, or a string wtih the version number</li><li>raw
|
71
|
+
# string containing the raw ID3 version 1 tag<br>
|
72
|
+
</li>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<h4>Instance Methods:</h4>
|
81
|
+
|
82
|
+
|
83
|
+
<ul>
|
84
|
+
|
85
|
+
|
86
|
+
<li>new</li>
|
87
|
+
<li>read<br>
|
88
|
+
</li>
|
89
|
+
<li>write # not yet implemented..</li>
|
90
|
+
<li>dump<br>
|
91
|
+
</li>
|
92
|
+
|
93
|
+
</ul>
|
94
|
+
|
95
|
+
|
96
|
+
<br>
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<h4>Hash-like Access:</h4>
|
102
|
+
|
103
|
+
|
104
|
+
When accessing a Tag1 object wtih the Hash syntax, you can access the
|
105
|
+
actual data in the tag. Please note that there is only a very limited
|
106
|
+
number of valid keys, and that the class does not allow "inventing" new
|
107
|
+
keys (as those would not be defined in the ID3 definition)<br>
|
108
|
+
|
109
|
+
|
110
|
+
<br>
|
111
|
+
|
112
|
+
|
113
|
+
<h4>Examples:</h4>
|
114
|
+
|
115
|
+
|
116
|
+
<pre> > require 'id3'<br> => true<br><br> > t = ID3::Tag1.new<br> => {}<br><br> > t.read('mp3/d.mp3')<br> => true<br><br> > t.version<br> => "1.1"<br><br> > t<br> => {"ARTIST"=>"Beatles, The", "ALBUM"=>"Abbey Road", "TRACKNUM"=>"1", "TITLE"=>"Come Together", "YEAR"=>"2002", "GENREID"=>"12", "COMMENT"=>"Provided by Vlet"}<br><br> > > t['ALBUM']<br> => "Abbey Road"<br><br> > t['ARTIST']<br> => "Beatles, The"<br><br> > t['ARTIST'] = "The Beatles"<br> => "The Beatles"<br><br> <b># PLEASE NOTE that the raw tag is read only, and reflects the data that was read from the file!</b><br> <br> > t.raw<br> => "TAGCome Together\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000Beatles, The\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000Abbey Road\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002002Provided by Vlet\000\000\000\000\000\000\000\000\000\000\000\000\000\001\f"<br><br> > t.raw.hexdump<br><br> index 0 1 2 3 4 5 6 7 8 9 A B C D E F<br><br> 00000000 54414743 6f6d6520 546f6765 74686572 TAGCome Together<br> 00000010 00000000 00000000 00000000 00000000 ................<br> 00000020 00426561 746c6573 2c205468 65000000 .Beatles, The...<br> 00000030 00000000 00000000 00000000 00000041 ...............A<br> 00000040 62626579 20526f61 64000000 00000000 bbey Road.......<br> 00000050 00000000 00000000 00000000 00323030 .............200<br> 00000060 3250726f 76696465 64206279 20566c65 2Provided by Vle<br> 00000070 74000000 00000000 00000000 0000010c t...............<br> => nil<br><br><b> # PLEASE NOTE that the the dump method dumps a new raw tag into a string, and reflects <br> # the current data of the Tag1 object (with the changes you might have made)<br><br> </b>> t.dump<br> => "TAGCome Together\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000The Beatles\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000Abbey Road\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002002Provided by Vlet\000\000\000\000\000\000\000\000\000\000\000\000\000\001\f"<br><br> > t.dump.hexdump<br><br> index 0 1 2 3 4 5 6 7 8 9 A B C D E F<br><br> 00000000 54414743 6f6d6520 546f6765 74686572 TAGCome Together<br> 00000010 00000000 00000000 00000000 00000000 ................<br> 00000020 00546865 20426561 746c6573 00000000 .The Beatles....<br> 00000030 00000000 00000000 00000000 00000041 ...............A<br> 00000040 62626579 20526f61 64000000 00000000 bbey Road.......<br> 00000050 00000000 00000000 00000000 00323030 .............200<br> 00000060 3250726f 76696465 64206279 20566c65 2Provided by Vle<br> 00000070 74000000 00000000 00000000 0000010c t...............<br> => nil<br><br> <br><b> # PLEASE NOTE that you can not just "make up" new field names<br><br></b> > t['something']<br> => nil<br><br> > t['something'] = 'is not allowed!!'<br> ArgumentError: Incorrect ID3-field "something" for ID3 version 1.1<br> valid fields are: ARTIST,ALBUM,TRACKNUM,TITLE,YEAR,GENREID,COMMENT<br><br> from ./id3.rb:636:in `[]='<br> from (irb):25<br> from :0<br><br></pre>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
</body></html>
|