Class Mp3Info
In: lib/mp3info.rb
lib/mp3info/extension_modules.rb
Parent: Object

Methods

close   hastag1?   hastag1?   hastag2?   hastag2?   hastag?   new   open   removetag1   removetag1   removetag2   removetag2   rename   to_s  

Constants

VERSION = "0.5"
LAYER = [ nil, 3, 2, 1]
BITRATE = [ [ [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448], [32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384], [32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320] ], [ [32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256], [8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160], [8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160]
SAMPLERATE = [ [ 44100, 48000, 32000 ], [ 22050, 24000, 16000 ]
CHANNEL_MODE = [ "Stereo", "JStereo", "Dual Channel", "Single Channel"]
GENRES = [ "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror", "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C", "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", "SynthPop" ]
TAGSIZE = 128
V1_V2_TAG_MAPPING = { "title" => "TIT2", "artist" => "TPE1", "album" => "TALB", "year" => "TYER", "tracknum" => "TRCK", "comments" => "COMM", "genre_s" => "TCON"   MAX_FRAME_COUNT = 6 number of frame to read for encoder detection

Attributes

bitrate  [R]  bitrate in kbps
channel_mode  [R]  channel mode => "Stereo", "JStereo", "Dual Channel" or "Single Channel"
error_protection  [R]  error protection => true or false
filename  [R]  the original filename
hastag1  [R]  Moved hastag1? and hastag2? to be booleans
hastag2  [R]  Moved hastag1? and hastag2? to be booleans
layer  [R]  layer = 1, 2, or 3
length  [R]  length in seconds as a Float
mpeg_version  [R]  mpeg version = 1 or 2
samplerate  [R]  samplerate in Hz
tag  [R]  a sort of "universal" tag, regardless of the tag version, 1 or 2, with the same keys as @tag1 this tag has priority over @tag1 and @tag2 when writing the tag with close
tag1  [RW]  id3v1 tag as a Hash. You can modify it, it will be written when calling "close" method.
tag2  [RW]  id3v2 tag attribute as an ID3v2 object. You can modify it, it will be written when calling "close" method.
vbr  [R]  variable bitrate => true or false

Public Class methods

Test the presence of an id3v1 tag in file filename

Test the presence of an id3v2 tag in file filename

Instantiate a new Mp3Info object with name filename

"block version" of Mp3Info::new()

Remove id3v1 tag from filename

Remove id3v2 tag from filename

Public Instance methods

Flush pending modifications to tags and close the file

Does the file has an id3v1 tag?

Does the file has an id3v2 tag?

Does the file has an id3v1 or v2 tag?

Remove id3v1 from mp3

write to another filename at close()

inspect inside Mp3Info

[Validate]