Slashdot Mirror


Cultured Perl: Fun with MP3 and Perl, Part 1

Ted writes "Every self-respecting computer and music fan needs to be able to manipulate MP3s -- the defacto standard for recreational digital music use. In this article, I'll look at ways to manage and manipulate MP3s (searching, tagging, renaming, commenting, etc.) using the autotag.pl application. I'll also take you through the application, illustrating how CPAN modules enable the application."

13 of 232 comments (clear)

  1. and like every Linux geek.. by rf0 · · Score: 5, Funny

    I'm going to say "Where the ogg version?" :)

    Rus

    1. Re:and like every Linux geek.. by Josh+Coalson · · Score: 5, Informative
      I'm going to say "Where the ogg version?"

      Right here. Or here for FLAC.

      Josh

    2. Re:and like every Linux geek.. by bwhaley · · Score: 4, Insightful

      I'm going to say "Where the ogg version?" :)

      At the risk of wasting some karma...

      I'm sick of hearing about Ogg. Great, it's free as in beer and freedom. I'm pro freedom. But seriously, it's not going to catch on. mp3 is here to stay my friends, and while ogg may be a technically superior format, the rest of the world is not going to convert the mp3 collection to ogg's. It's just not going to happen. And if nobody converts their files to ogg's, why would manufacturers waste development time and costs putting ogg support into their products?

      Maybe I'm being cynical but I think it would take a miracle at this point.

      --
      "I either want less corruption, or more chance
      to participate in it." -- Ashleigh Brilliant
    3. Re:and like every Linux geek.. by Minna+Kirai · · Score: 5, Insightful

      And if nobody converts their files to ogg's, why would manufacturers waste development time and costs putting ogg support into their products?

      So they can have a superior format without the risk of Apple or Microsoft quadrupling the license fees 9 months down the line.

      Actually, because Microsoft is pushing their own audio format, manufacturers will have a low-cost chance to push Ogg. They're going to have to expand the devices to recognize non-mp3 files anyhow... why not throw in the free integerized Ogg code while they're at it?

  2. Another MP3 tagging library.... by tcopeland · · Score: 5, Informative
    ...written in Ruby, can be found right here. From the project page:

    mp3taglib is a id3v1/id3v2 mp3 tagging library for ruby, based on id3lib. At
    this early stage it already supports most of the fields of id3v2 tags. Mp3
    encoding informations can also be retrieved.
  3. Nice to know... by jargoone · · Score: 5, Informative

    It's nice to know you can do this, and I've used the modules referenced for custom fixes. But don't reinvent the wheel if you don't have to: EasyTag probably does 90% of what you would write something custom for.

    1. Re:Nice to know... by rf0 · · Score: 4, Insightful

      Hes an engineer so he will, like most of us spend 20 hours writing something when he could do it in 10 with someone else code or in 5 if doing it manually

      Rus

  4. Why stop with tagging? by Dr.+Zowie · · Score: 5, Interesting
    Perl (with PDL) is powerful enough to remix, comb-filter, compress, depop, noise-gate, and generally munge your mp3s as much as you want.

    We're in an exciting time when many of the scripting languages are being augmented to be able to handle Real Data (Numpy is another example).

  5. What about emacs MP3 mode? by crow · · Score: 4, Interesting

    Seriously, I've been thinking it would be cool to have an emacs mode for MP3 files. The raw data wouldn't be displayed, but the ID3 tags would be available for editing.

  6. Re:Perl.com article by blech · · Score: 5, Informative

    To be fair, the MusicBrainz article for perl.com (that, full disclosure time, I wrote) doesn't cover as much ground as the Developer Works article, which seems to be going through all the steps needed to write an autotagger in Perl.

    However, I was a little dissapointed that Teodor didn't spell out more of his reasoning for his choice of modules. I covered the (then) available Perl mp3 modules for a talk at YAPC::Europe this summer, and if you're not sure which modules to use, I'd suggest having a look at the slides (80K PDF) and notes.

    In any case, I look forward to the second part of the article, to see how the script shakes out in the end.

    --
    DO NOT LEAVE IT IS NOT REAL
  7. Re:Tagging my ass... by drinkypoo · · Score: 4, Insightful
    ID3 tags exist so that even "improperly" named MP3 files can have valid information. Also, would you prefer to encode artist, title, album, and track number information in every MP3? I god damn HATE it when people put ALL that in there. The filenames frequently exceed filesystem limits; They won't even fit on a mode 2 ISO9660 cdrom (let alone MODE1), so you can NOT put all that information into the title. An ID3-tagged mp3 will preserve all that information and more (You can even put lyrics into your ID3v2-tagged files) regardless of the filename.

    Filenames are not an appropriate place to store metadata because they are volatile when moving a file between media.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  8. Re:How come many Mp3's don't have this data? by blech · · Score: 5, Informative

    Generally, CDs don't have all the track information on the CD. RealPlayer, Windows Media, iTunes and so on all use a computed identifier of some sort, based on the length of tracks, typically, to look up the CD information from an online database.

    Of course, because this means that *someone*, *somewhere*, ended up typing in the data, there are errors in a lot of the data. Most of the CD lookup databases are very bad at handling compiliations, and can have problems with any of the items of metadata other than title and artist (for example, 'year' often ends up as the year the CD is ripped, not the year the music was produced).

    There aren't many programs that strip the data that's produced, though. Thankfully.

    --
    DO NOT LEAVE IT IS NOT REAL
  9. Re:Hopefully iTunes will defeat mp3 by jdreed1024 · · Score: 4, Informative
    Ipod is only cool that it will play an mp3, their wierd itunes format is not desired as it is not compatable with 99.9% of the hardware out there.

    Besides, I will not tolerate ANY DRM in my music files.

    By "weird itunes format", I assume you're referring to the AAC MPEG4 format, which is an industry standard.

    Also, there's only DRM in files that you buy from iTunes Music store. Please stop spreading the FUD that "AAC == DRM", because it's simply not true. Just like "EXE file" does not translate to "software which needs a registration key" and "VHS tape" does not translate to "protected by Macrovision". AAC is an open MPEG4 format to which DRM _CAN_ be applied. By default, it is not applied.

    Also, what do you mean by "A2D" converter? Why would an MP3 player, which decodes digital signals into analog signals which your ear can hear need an "analog to digital to converter"?

    --
    There is no sig, there is only Zuul.