Last change
on this file since 47 was
37,
checked in by peter, 10 years ago
|
id3dump, id3load, id3ascii: scripts to dump and load ID3 info from an Mp3 file, and a script that converts ID3 tags down to ASCII-only
|
-
Property svn:executable set to
*
|
File size:
519 bytes
|
Rev | Line | |
---|
[37] | 1 | #!/usr/bin/perl -w |
---|
| 2 | use strict; |
---|
| 3 | |
---|
| 4 | # prints ID3 tag info from an MP3 file in Vorbis tag format to STDOUT |
---|
| 5 | |
---|
| 6 | use MP3::Tag; |
---|
| 7 | |
---|
| 8 | my $audio_file = shift or die "Usage: $0 <mp3-file>\n"; |
---|
| 9 | my $mp3 = MP3::Tag->new($audio_file); |
---|
| 10 | |
---|
| 11 | my %key_for = ( |
---|
| 12 | ALBUM => 'album', |
---|
| 13 | ARTIST => 'artist', |
---|
| 14 | DATE => 'year', |
---|
| 15 | TITLE => 'title', |
---|
| 16 | TRACKNUMBER => 'track', |
---|
| 17 | ); |
---|
| 18 | |
---|
| 19 | my $info = $mp3->autoinfo; |
---|
| 20 | |
---|
| 21 | for my $vorbis_tag (sort keys %key_for) { |
---|
| 22 | print "$vorbis_tag=" . ($info->{$key_for{$vorbis_tag}} || '') . "\n"; |
---|
| 23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.