[Gllug] RE: Create IDv3 Tag command line
David Abbishaw
David at Abbishaw.com
Mon Dec 20 08:09:06 UTC 2004
Cheers Phil I'll give that a go.
Thanks.
I've never come across one, but it looks like there are several Perl
modules whioh
would achieve this, for example:-
http://search.cpan.org/~svanzoest/MP3-ID3v1Tag-1.11/lib/MP3/ID3v1Tag.pm
If you were to install this module you could use the following Perl script:-
#!/usr/local/bin/perl -w
# Name: create-id3-tag.pl
use strict;
use MP3::ID3v1Tag;
my $status = 0;
my $filename = shift;
my $mp3_file = new MP3::ID3v1Tag($filename);
unless($mp3_file->got_tag()) {
print "\'$filename\'\n";
$mp3_file->set_title("No Title Name");
$mp3_file->set_artist("No Artist Name");
$mp3_file->set_album("No Album Title");
$mp3_file->set_year(1999);
$mp3_file->set_comment('No Comment');
$mp3_file->set_genre_num(0);
$status = $mp3_file->save();
}
exit 0;
Then it would be simply a case of something like:-
find <path-to-mp3s> -type f -name "*.mp3" -exec ./create-id3-tag.pl {} \;
Hope this gives you something to play with :) I've given it a quick test
and it
appears to work.
--
Regards
Phil
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list