forked from moumar/ruby-mp3info
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.txt
More file actions
82 lines (58 loc) · 1.88 KB
/
README.txt
File metadata and controls
82 lines (58 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
= ruby-mp3info
* http://github.com/moumar/ruby-mp3info
== DESCRIPTION:
ruby-mp3info read low-level informations and manipulate tags on
mp3 files.
== FEATURES/PROBLEMS:
* written in pure ruby
* read low-level informations like bitrate, length, samplerate, etc...
* read, write, remove id3v1 and id3v2 tags
* correctly read VBR files (with or without Xing header)
* only 2.3 version is supported for writings id3v2 tags
* id3v2 tags are always written in UTF-16 encoding
== SYNOPSIS:
### read and display infos & tags
require "mp3info"
# read and display infos & tags
Mp3Info.open("myfile.mp3") do |mp3info|
puts mp3info
end
# read/write tag1 and tag2 with Mp3Info#tag attribute
# when reading tag2 have priority over tag1
# when writing, each tag is written.
Mp3Info.open("myfile.mp3") do |mp3|
puts mp3.tag.title
puts mp3.tag.artist
puts mp3.tag.album
puts mp3.tag.tracknum
mp3.tag.title = "track title"
mp3.tag.artist = "artist name"
end
# tags are written when calling Mp3Info#close or at the end of the #open block
### access id3v2 tags
Mp3Info.open("myfile.mp3") do |mp3|
# you can access four letter v2 tags like this
puts mp3.tag2.TIT2
mp3.tag2.TIT2 = "new TIT2"
# or like that
mp3.tag2["TIT2"]
# at this time, only COMM tag is processed after reading and before writing
# according to ID3v2#options hash
mp3.tag2.options[:lang] = "FRE"
mp3.tag2.COMM = "my comment in french, correctly handled when reading and writing"
end
== REQUIREMENTS:
* iconv
== INSTALL:
* gem install ruby-mp3info
== DEVELOPERS:
After checking out the source, run:
$ rake newb
This task will install any missing dependencies, run the tests/specs,
and generate the RDoc.
== LICENSE:
ruby
== TODO:
* encoder detection
* support for more tags in id3v2
* generalize id3v2 with other audio formats (APE, MPC, OGG, etc...)