source: flacrip/trunk/id3dump @ 46

Last change on this file since 46 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
Line 
1#!/usr/bin/perl -w
2use strict;
3
4# prints ID3 tag info from an MP3 file in Vorbis tag format to STDOUT
5
6use MP3::Tag;
7
8my $audio_file = shift or die "Usage: $0 <mp3-file>\n";
9my $mp3 = MP3::Tag->new($audio_file);
10
11my %key_for = (
12    ALBUM       => 'album',
13    ARTIST      => 'artist',
14    DATE        => 'year',
15    TITLE       => 'title',
16    TRACKNUMBER => 'track',
17);
18
19my $info = $mp3->autoinfo;
20
21for 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.