MP3::T...2_Data(3pm)
π MP3::Tag::ID3v2_Data β get_frame() data format and supported frames π
okay bestie, welcome to the glow-up doc for MP3::Tag::ID3v2_Data, straight out of the User Contributed Perl Documentation section of your local man pages. this is the page that tells you what you actually get back when you call get_frame on an MP3::Tag::ID3v2 object. no cap. π¦
β¨ SYNOPSIS β¨
$mp3 = MP3::Tag->new($filename);
$mp3->get_tags();
$id3v2 = $mp3->{ID3v2} if exists $mp3->{id3v2};
($info, $long) = $id3v2->get_frame($id); # or
($info, $long) = $id3v2->get_frame($id, 'raw');
that's the whole vibe. two little values, $info and $long, and they're about to change your life (or at least your tag-reading code). π
πΈ DESCRIPTION πΈ
this document describes how to use the results of the get_frame function of MP3::Tag::ID3v2, thus the data format of frames retrieved with MP3::Tag::ID3v2::get_frame().
it also contains a list of all supported ID3v2-Frames. yes, all of them. we're not gatekeeping. π₯
π get_frame() π
($info, $long) = $id3v2->get_frame($id); # or
($info, $long) = $id3v2->get_frame($id, 'raw');
$id has to be a name of a frame like "APIC". for more variants of calling, see get_frame().
and listen β the names of all frames found in a tag can be retrieved with the get_frame_ids() function. so you don't have to guess, bestie, you can just ask. π
π Using the returned data π
in the ID3v2.3 specifications 73 frames are defined, which can contain very different information. that means that get_frame returns the information of different frames also in different ways. it's giving chaotic. it's giving iconic. both.
β Simple Frames
a lot of the tags contain only a text string and encoding information. if you call ($info, $long) = $id3v2->get_frame($id) for such a frame, $info will contain the text string and $long will contain the english name of the frame.
example:
get_frame("TIT2"); # returns
("Birdhouse In Your Soul", "Title/songname/content description")
literally so easy. ate. π
π§ Complex Frames
for more complex frames the returned $info is a reference to a hash, where each entry of the hash describes a part of the information found in the frame. the key of a hash entry contains the name of this part, the according value contains the information itself.
example:
get_frame("APIC"); # returns
( { "Description" => "Flood",
"MIME Type" => "/image/jpeg",
"Picture Type" => "Cover (front)",
"_Data" => "..data of jpeg picture (binary).."
},
"Attached Picture");
a whole little hash, just for you. main character energy fr fr. π
π«Ά Other Frames
some frames are not supported at the moment, ie the data found in the frame is not returned in a descriptive way. but you can read the data of this frames (and also of all other frames too) in raw mode. then the complete data field of the frame is returned, without any modifications. this means that the returned data will be almost binary data. π
example:
get_frame("TIT2", 'raw'); # returns
("\x00Birdhouse In Your Soul", "Title/songname/content description")
see that \x00? that's the encoding byte peeking through. raw mode does not hold back, it does not censor, it gives you the bytes exactly as they are. π
the frames which (in addition to"Text"/"URL") contain only"Description"and"Language"fields are in some intermediate position between "simple" and "complex" frames. they can be handled very similarly to "simple" frames by using "long names", such asCOMM[description]orCOMM(LANG)[description], and the corresponding "quick" API such asframe_select().
so yes, there's a lil middle ground. they're in their soft-launch era. π
π List of Simple Frames π
following Frames are supported and return a single string (text). in the List you can find the frame IDs and the long names of the frames as returned by $id3v2->get_frame():
IPLS: Involved people listMCDI: Music CD identifierPCNT: Play counterTALB: Album/Movie/Show titleTBPM: BPM (beats per minute)TCOM: ComposerTCON: Content typeTCOP: Copyright messageTDAT: DateTDLY: Playlist delayTDRC: Recording timeTENC: Encoded byTEXT: Lyricist/Text writerTFLT: File typeTIME: TimeTIPL: Involved people listTIT1: Content group descriptionTIT2: Title/songname/content descriptionTIT3: Subtitle/Description refinementTKEY: Initial keyTLAN: Language(s)TLEN: LengthTMCL: Musician credits listTMED: Media typeTOAL: Original album/movie/show titleTOFN: Original filenameTOLY: Original lyricist(s)/text writer(s)TOPE: Original artist(s)/performer(s)TORY: Original release yearTOWN: File owner/licenseeTPE1: Lead performer(s)/Soloist(s)TPE2: Band/orchestra/accompanimentTPE3: Conductor/performer refinementTPE4: Interpreted, remixed, or otherwise modified byTPOS: Part of a setTPUB: PublisherTRCK: Track number/Position in setTRDA: Recording datesTRSN: Internet radio station nameTRSO: Internet radio station ownerTSIZ: SizeTSRC: ISRC (international standard recording code)TSSE: Software/Hardware and settings used for encodingTYER: YearWCOM: Commercial informationWCOP: Copyright/Legal informationWOAF: Official audio file webpageWOAR: Official artist/performer webpageWOAS: Official audio source webpageWORS: Official internet radio station homepageWPAY: PaymentWPUB: Publishers official webpage
52 of them. all returning one humble little string. we love consistency. π
π¦ List of Complex Frames π¦
following frames are supported and return a reference to a hash. the list shows which keys can be found in the returned hash:
AENC: Audio encryption- Keys: URL, Preview start, Preview length, _Data
APIC: Attached picture- Keys: MIME type, Picture Type, Description, _Data
COMM: Comments- Keys: Language, Description, Text
COMR: Commercial frame- Keys: Price, Valid until, URL, Received as, Name of Seller, Description, MIME type, _Logo
ENCR: Encryption method registration- Keys: Owner ID, Method symbol, _Data
GEOB: General encapsulated object- Keys: MIME type, Filename, Description, _Data
GRID: Group identification registration- Keys: Owner, Symbol, _Data
LINK: Linked information- Keys: ID, URL, Text
OWNE: Ownership frame- Keys: Price payed, Date of purchase, Text
POPM: Popularimeter- Keys: URL, Rating, Counter
PRIV: Private frame- Keys: Text, _Data
RBUF: Recommended buffer size- Keys: Buffer size, Embedded info flag, Offset to next tag
RVRB: Reverb- Keys: Reverb left (ms), Reverb right (ms), Reverb bounces (left), Reverb bounces (right), Reverb feedback (left to left), Reverb feedback (left to right), Reverb feedback (right to right), Reverb feedback (right to left), Premix left to right, Premix right to left
SYTC: Synchronized tempo codes- Keys: Time Stamp Format, _Data
TXXX: User defined text information frame- Keys: Description, Text
UFID: Unique file identifier- Keys: Text, _Data
USER: Terms of use- Keys: Language, Text
USLT: Unsychronized lyric/text transcription- Keys: Language, Description, Text
WXXX: User defined URL link frame- Keys: Description, URL
the RVRB one is lowkey a whole essay of keys and i respect it for that. π
π List of Other Frames π
following frames are only supported in raw mode:
CRM: Encrypted meta frameEQUA: EqualizationETCO: Event timing codesLNK: Linked informationMLLT: MPEG location lookup tablePIC: Attached picturePOSS: Position synchronisation frameRVAD: Relative volume adjustmentSYLT: Synchronized lyric/text
raw mode is right there waiting if you need them, bestie. no frame left behind. π«Ά
π SEE ALSO π
MP3::TagMP3::Tag::ID3v2
and that's the page!! go read some tags, slay, be free. β¨
sign-off szn π β this lil masterpiece is shipped with perl v5.36.0, dated 2022-12-30, and lives happily inside the User Contributed Perl Documentation collection. mwah. π
π¦ where this page comes from
- debian bookworm: libmp3-tag-perl 1.16-1 Β· Artistic-1.0-Perl
- debian trixie: libmp3-tag-perl 1.16-1 Β· Artistic-1.0-Perl
- ubuntu noble: libmp3-tag-perl 1.16-1 Β· Artistic-1.0-Perl
- ubuntu resolute: libmp3-tag-perl 1.16-1 Β· Artistic-1.0-Perl
- ubuntu stonking: libmp3-tag-perl 1.16-1 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms