[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MP3 ID3 Tags



Since the sample code I gave below doesn't call 'print_tag', perhaps you are 
using the sample code in the module docs? (which did, IIRC)

The command line arguments in the code I gave below is expecting a DIRECTORY
list, not files. Be careful of your wildcard expansion. Maybe test in
'wanted' to make sure the entry is a file as well. It might barf on a
directory called "my.mp3".

Perhaps taking a look at what line 83 in 
/usr/lib/perl5/site_perl/5.6.0/MP3/ID3v1Tag.pm does?
Or line 12 in /usr/local/bin/tagchange.pl?

Try printing $File::Find::name and using the debugger. e.g.
  perl -d /usr/local/bin/tagchange.pl /some/directory/of/mp3s

and stepping through until you hit the error (i.e. line 83 in MP3::ID3v1Tag).

Without your source code (of tagchange.pl) and the exact command line
you issued, unfortunately we can't help any more than to suggest that
you read the error message and try to understand why the program is doing
exactly what you told it to do.

Mike808/

Tim Grossner wrote:
> 
> The module seemed to install ok but i am getting
> 
> : Is a directory at
> /usr/lib/perl5/site_perl/5.6.0/MP3/ID3v1Tag.pm line 83, <FILES> line 14.
> Can't call method "print_tag" on an undefined value at
> /usr/local/bin/tagchange.pl line 12, <FILES>
> line 14.
> 
> On Thu, 23 May 2002, Mike808 wrote:
> 
> > Anyone up for a game of golf?
> >
> > > #!/usr/local/bin/perl
> > > use File::Find;
> > > use MP3::ID3v1Tag;
> > >
> > > my @directories_to_search = @ARGV;
> > > find (\&wanted, @directories_to_search);
> > > sub wanted {
> > >
> > >   return unless m/\.mp3$/i; # Skip unless it has an MP3 extension
> > >
> > >   my $mp3_file = MP3::ID3v1Tag->new($_);
> > >   return unless $mp3_file; # Done if not an MP3 file
> > >   return unless $mp3_file->got_tag; # Done if no tag
> > >
> > >   my $genre = $mp3_file->get_genre(); # Get the current tag
> > >
> > >   $mp3_file->set_genre("Blues"); # Set the tag by name
> > >   $mp3_file->set_genre_num(0);   # Or use the genre numbers
> > >
> > >   my $save_status = $mp3_file->save; # Save the changes
> > >
> > >   print "$File::Find::name updated\n"; # Tell the user
> > > }
> > > 1;
> >
> >
> 
> --
> 
> Tim Grossner
> voice - 217-438-6161
> pager - 217-467-3148
> cell - 217-971-3060
> data - tg@cityscape.net
> (GPG/PGP key available at http://www.cityscape.net/~tg/tim.grossner.gpg or http://www.wirelessways.org/~tg/tim.grossner.gpg
> meatspace address - 202 Harrison, Auburn, Illinois 62615
> 
> -
> To unsubscribe, send email to majordomo@luci.org with
> "unsubscribe luci-discuss" in the body.

-- 
() Join the ASCII ribbon campaign against HTML email and Microsoft-specific
/\ attachments. If I wanted to read HTML, I would have visited your website!
Support open standards.

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.