Class | Mp3Info |
In: |
lib/mp3info.rb
lib/mp3info/extension_modules.rb |
Parent: | Object |
VERSION | = | "0.6.13" | ||
LAYER | = | [ nil, 3, 2, 1] | ||
BITRATE | = | { 1 => [ [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] ], 2 => [ [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 | = | { 1 => [ 44100, 48000, 32000 ], 2 => [ 22050, 24000, 16000 ], 2.5 => [ 11025, 12000, 8000 ] | ||
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" ] | ||
TAG1_SIZE | = | 128 | ||
TAG_MAPPING_2_2 | = | { "title" => "TT2", "artist" => "TP1", "album" => "TAL", "year" => "TYE", "tracknum" => "TRK", "comments" => "COM", "genre_s" => "TCO" | map to fill the "universal" tag (tag attribute) for id3v2.2 | |
TAG_MAPPING_2_3 | = | { "title" => "TIT2", "artist" => "TPE1", "album" => "TALB", "year" => "TYER", "tracknum" => "TRCK", "comments" => "COMM", "genre_s" => "TCON" | for id3v2.3 and 2.4 | |
SAMPLES_PER_FRAME | = | [ nil, {1=>384, 2=>384, 2.5=>384}, # Layer I {1=>1152, 2=>1152, 2.5=>1152}, # Layer II {1=>1152, 2=>576, 2.5=>576} | www.codeproject.com/audio/MPEGAudioInfo.asp |
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 |
header | [R] |
Hash representing values in the MP3 frame header. Keys are one of the
following:
detailled explanation can be found here: www.mp3-tech.org/programmer/frame_header.html |
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 |
this method returns the "audio-only" data boundaries of the file, i.e. content stripped form tags. Useful to compare 2 files with the same audio content but with differents tags. Returned value is an array [position_in_the_file, length_of_the_data]