Get_frame() data format and supported frames
$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');
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 contains also a list of all supported ID3v2-Frames.
($info, $long) = $id3v2->get_frame($id); # or
($info, $long) = $id3v2->get_frame($id, 'raw');
$id has to be a name of a frame like \*(L"\s-1APIC\s0\*(R". For more variants of calling see get_frame().
The names of all frames found in a tag can be retrieved with the get_frame_ids() function.
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.
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(\*(L"\s-1TIT2\s0\*(R"); # returns
("Birdhouse In Your Soul", "Title/songname/content description")
For more complex frames the returned $info is a reference to a hash, where each entry of the hash decribes 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(\*(L"\s-1APIC\s0\*(R"); # returns
( { "Description" => "Flood", "MIME Type" => "/image/jpeg", "Picture Type" => "Cover (front)", "_Data" => "..data of jpeg picture (binary).." }, "Attached Picture");
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(\*(L"\s-1TIT2\s0\*(R", 'raw'); # returns
("\x00Birdhouse In Your Soul", "Title/songname/content description")
The frames which (in addition to \*(C`Text\*(C'/\*(C`URL\*(C') contain only \*(C`Description\*(C' and \*(C`Language\*(C' fields are in some intermediate position between \*(L"simple\*(R" and \*(L"complex\*(R" frames. They can be handled very similarly to \*(L"simple\*(R" frames by using \*(L"long names\*(R", such as \*(C`COMM[description]\*(C' or \*(C`COMM(LANG)[description]\*(C', and the corresponding \*(L"quick\*(R" \s-1API\s0 such as frame_select().
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():
Following frames are supported and return a reference to a hash. The list shows which keys can be found in the returned hash:
Keys: URL, Preview start, Preview length, _Data
Keys: MIME type, Picture Type, Description, _Data
Keys: Language, Description, Text
Keys: Price, Valid until, URL, Received as, Name of Seller, Description, MIME type, _Logo
Keys: Owner ID, Method symbol, _Data
Keys: MIME type, Filename, Description, _Data
Keys: Owner, Symbol, _Data
Keys: ID, URL, Text
Keys: Price payed, Date of purchase, Text
Keys: URL, Rating, Counter
Keys: Text, _Data
Keys: Buffer size, Embedded info flag, Offset to next tag
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
Keys: Time Stamp Format, _Data
Keys: Description, Text
Keys: Text, _Data
Keys: Language, Text
Keys: Language, Description, Text
Keys: Description, URL
Following frames are only supported in raw mode:
MP3::Tag, MP3::Tag::ID3v2