perl bindings ID3v2::Frame subclasses

Aaron VonderHaar gruen0aermel at
Fri Mar 3 05:06:41 CET 2006

I'm trying to use the Audio::TagLib perl bindings to access ID3v2- 
specific frames, but when I iterate through the FrameList, all the  
frames seem to be instances of Frame and not of the correct subclasses.

my $file = Audio::TagLib::FileRef->new("test.mp3");
my $tag = Audio::TagLib::ID3v2::Tag->new($file->file, 0);

tie my @frames, ref($tag->frameList()), $tag->frameList();

foreach my $frame (@frames) {
         print ref($frame), "\n";  ### This prints  
"Audio::TagLib::ID3v2::Frame" for every frame
         eval { print $frame->text(), "\n"; };  ### This fails even  
for COMM frames

How can I determine the class of the frame, and how can I access the  
member functions for each subclass?

Aaron V.

More information about the taglib-devel mailing list