Actions

&johncdvorak: Difference between revisions

From Mike Beane's Blog

(New page: While writing my perl Sansa mp3 player podcast sync program, I came across the issue that the mp3 audio for the CrankyGeeks podcast is without id3 tag information. This royally messes up ...)
 
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
While writing my perl Sansa mp3 player podcast sync program, I came across the issue that the mp3 audio for the CrankyGeeks podcast is without id3 tag information.  This royally messes up my list.  As a short irony, I noticed that the last KFI Tech Guy with Leo Laporte was without a few tags, causing it to fall into the <unknown> category on the player.
While writing my perl Sansa mp3 player [[Podcast Synch Batch File|podcast sync program]], I came across the issue that the mp3 audio for the CrankyGeeks podcast is without id3 tag information.  This royally messes up my list.  As a short irony, I noticed that the last KFI Tech Guy with Leo Laporte was without a few tags, causing it to fall into the <unknown> category on the player.


Leo has enough stuff derived from his name, so I wrote the &johncdvorak subroutine
Leo has enough stuff derived from his name, so I wrote the &johncdvorak subroutine
In the example below, only 1 mp3 file came through with any tag info (#66), the rest are artificial.
[[Image:Johncdvorak.jpg]]
<pre>
Portable Player Drive is J:
Checking source files to move to destination:
Did not find J:/MUSIC/Podcasts/Cranky Geeks MP3 Audio
Created J:/MUSIC/Podcasts/Cranky Geeks MP3 Audio
Copying CrankyGeeks 058.mp3
Checked ID3v1 tags for CrankyGeeks 058.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 059.mp3
Checked ID3v1 tags for CrankyGeeks 059.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 060.mp3
Checked ID3v1 tags for CrankyGeeks 060.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 061.mp3
Checked ID3v1 tags for CrankyGeeks 061.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 062.mp3
Checked ID3v1 tags for CrankyGeeks 062.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 063.mp3
Checked ID3v1 tags for CrankyGeeks 063.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 064.mp3
Checked ID3v1 tags for CrankyGeeks 064.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 066.mp3
Checked ID3v1 tags for CrankyGeeks 066.mp3:
Title: CrankyGeeks Episode 66, May 30, 2007 Artist: John C. Dvorak Genre: Podcast
Copying CrankyGeeks 067.mp3
Checked ID3v1 tags for CrankyGeeks 067.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Reading On The Go.plp for files to remove from portable:
Checking for files removed from source:
</pre>


Here are the excerpts of the main file:
Here are the excerpts of the main file:
Line 60: Line 99:


</pre>
</pre>
[[Category:Weblog-2007-06]]
[[Category:Perl]]

Latest revision as of 19:39, 31 December 2007

While writing my perl Sansa mp3 player podcast sync program, I came across the issue that the mp3 audio for the CrankyGeeks podcast is without id3 tag information. This royally messes up my list. As a short irony, I noticed that the last KFI Tech Guy with Leo Laporte was without a few tags, causing it to fall into the <unknown> category on the player.

Leo has enough stuff derived from his name, so I wrote the &johncdvorak subroutine

In the example below, only 1 mp3 file came through with any tag info (#66), the rest are artificial.

Johncdvorak.jpg

Portable Player Drive is J:
Checking source files to move to destination:
Did not find J:/MUSIC/Podcasts/Cranky Geeks MP3 Audio
Created J:/MUSIC/Podcasts/Cranky Geeks MP3 Audio
Copying CrankyGeeks 058.mp3
Checked ID3v1 tags for CrankyGeeks 058.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 059.mp3
Checked ID3v1 tags for CrankyGeeks 059.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 060.mp3
Checked ID3v1 tags for CrankyGeeks 060.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 061.mp3
Checked ID3v1 tags for CrankyGeeks 061.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 062.mp3
Checked ID3v1 tags for CrankyGeeks 062.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 063.mp3
Checked ID3v1 tags for CrankyGeeks 063.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 064.mp3
Checked ID3v1 tags for CrankyGeeks 064.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Copying CrankyGeeks 066.mp3
Checked ID3v1 tags for CrankyGeeks 066.mp3:
Title: CrankyGeeks Episode 66, May 30, 2007 Artist: John C. Dvorak Genre: Podcast
Copying CrankyGeeks 067.mp3
Checked ID3v1 tags for CrankyGeeks 067.mp3:
Title: CrankyGeeks Artist: CrankyGeeks Genre: Podcast
Reading On The Go.plp for files to remove from portable:
Checking for files removed from source:

Here are the excerpts of the main file:

use MP3::Info;

&johncdvorak($checkmp3tag,$checkmp3name);


sub johncdvorak
    {
    #This routine is dedicated to John C Dvorak by way of CrankyGeeks
    my $file=$checkmp3tag;
    my $mp3 = new MP3::Info $file;
           
        my $newtag=();
        if ($checkmp3name =~ m/(.*).mp3/)
        {
        $newtag=$1;
        
        #Strip out numbers.  If we're lucky
        #we'll have a nice name for the tag w/o
        #show/ep numbers
        
        $newtag =~ s/[0-9]//g;  
        }            

        if ($mp3->title eq "")
            {
            $tag->{TITLE} = $newtag;
            set_mp3tag($checkmp3tag, $tag);
            }
        if ($mp3->artist eq "")
            {
            $tag->{ARTIST} = $newtag;
            set_mp3tag($checkmp3tag, $tag);
            }
        if ($mp3->album eq "")
            {
            $tag->{ALBUM} = $newtag;
            set_mp3tag($checkmp3tag, $tag);
            }
        if ($mp3->genre eq "")
            {
            #You must edit MP3\Info.pm and add Podcast to the genres
            #for this to work.  If I remember, I'll email Chris Nandor
            #and relay that. [email protected]
            $tag->{GENRE} = 'Podcast';
            set_mp3tag($checkmp3tag, $tag);
            }
        $mp3 = new MP3::Info $file;
        printf "Checked ID3v1 tags for $checkmp3name:\n title: %s - artist: %s - genre: %s\n",
                $mp3->title, $mp3->artist, $mp3->genre;
        #ref: FILE, TITLE, ARTIST, ALBUM, YEAR, COMMENT, GENRE
    }