Slashdot Mirror


Cultured Perl: Fun with MP3 and Perl, Part 2

Ted writes "I continues to look at manipulating and guessing MP3 tags with Perl, FreeDB, and various CPAN models via my autotag.pl application. Writing autotag.pl was grueling but fun. I used fuzzy string matching, FreeDB searches, ID3 versions 1 and 2, and lots of text-mode user interactions. It all came together in an application that I tested thoroughly over the course of a month. Info and Slashdot comments about Part One can be seen here, which was posted in December."

7 of 55 comments (clear)

  1. Mmm Perl by Michael.Forman · · Score: 4, Informative

    As long as we're on the topic of useful perl scripts for manipulating metadata, let me offer some other scripts as well.
    • ren-regexp - A perl script that renames many files in parallel using a series of regular expressions from the command line. It's a profoundly useful script for those who are command-line and regexp power users.
    • mp3-ren-nice - A perl script that attemts to clean up munged mp3 file names downloaded from P2P networks. For example running the script on "artist-title_title.2.MP3" will yield "Artist - Title Title.mp3".
    • newpl - A perl script that creates an empty perl script template complete with GetOptions code and a POD skeleton for writing more scripts that manipulate mp3 files.
    That and more here. Now wasn't that informative?

    Michael.
    --
    Linux : Mac :: VW : Mercedes
    1. Re:Mmm Perl by addaon · · Score: 4, Informative

      I wasn't the original poster, but I can tell you why it bothers me. Using spaces and other non-normal characters in filenames means that the files actual name is different from the typed representation of the file name. So "My File" needs to be referred to as "My\ File". Now, this isn't so big a deal if all you ever do is use the command line. But I tend to interact with guis at times. And the two major operations I perform between guis and clis is copy and paste and drag and drop. Both fail with filenames with spaces. If I copy a file name "My File" and paste it to the terminal (or drag and drop the file there, which has exactly the same effect), the text that is automatically entered does not represent what I intended it to. This is broken behavior and, while it could be worked around (especially in the drag and drop case, there's no reason for the gui not to make the correction if it knows it's being dropped in a terminal), it's easier just to avoid it entirely.

      --

      I've had this sig for three days.
  2. Musicbrainz? by magnum3065 · · Score: 4, Informative

    Isn't this the kind of thing MusicBrainz was invented for. For those who don't know about it MusicBrainz is like CDDB, but you can look up files based on an audio fingerprint as well as the tag information. This means that files could be tagged completely wrong and you can still match them in the database. They provide open-source software for generating the fingerprints, interfacing with the server, and the server software (should you, for some strange reason want to run your own site). There's a pretty easy-to-use client for Windows, and I've been considering writing my own client for Linux.

    1. Re:Musicbrainz? by windex82 · · Score: 2, Informative

      Informative, bah! Magnum forgot the most important part!


      Latest Version

      The MusicBrainz tagger is currently only available for Windows.

    2. Re:Musicbrainz? by DrSkwid · · Score: 2, Informative

      If anyone was interested they should know the code is in C++

      oh well.

      http://cvs.musicbrainz.org/cvs/mb_tagger/

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    3. Re:Musicbrainz? by TedZ · · Score: 2, Informative

      Please read the comments for the first article. And/or the article itself.

      I tried MusicBrainz and didn't like the interface to it, or its capabilities. FreeDB was much better for my purpose.

      Ted (article author)

  3. This is exactly what I need. by BrookHarty · · Score: 3, Informative

    I copied all my cd's to mp3s on my harddrive, one thing, no ID3 tags.
    Lucky, what I did do, is named them all with tracknumber-band-song.mp3 in each subdirectory.

    Now that I have like 200 some directories, I don't want to go in with id3master on windows and make a id3 version1/2 tags on every file.

    This is exactly what I need! I use cygwin to write small perl scripts to generate reports, so this should be a snap. He even has examples on how to use his perl modules.

    Wow, nice for IBM to have a linux developers forum.