pwnt.be

Mass-Convert Your Music

While flash storage is reasonably affordable these days, your average portable audio player probably won’t be able to hold your entire music collection. That’s why it couldn’t hurt to convert—or, if you like it fancy, “transcode”—all your songs to a more economical format, allowing you to carry around as many of your favorite songs as possible.

2009-03 München 024
2009-03 München 024 by Allie_Caulfield
Some rights reserved

Let’s say you wanted to convert audio files in any input format—MP3, FLAC, WAV, or whatever—to a single, uniform output format—Ogg Vorbis, for instance. Sure, you could go hunting for a shareware tool with a half-assed GUI, but why should you? Free and Open Source utilities exist for just about any format, so it’s a matter of chaining them together.

Luckily, you don’t need to do the chaining, since I wrote replicator.pl to do just that. The script will clone an entire directory tree, converting any audio file it encounters, and updating M3U playlists to match. Windows users will want to look into ActivePerl; most other OSes come with Perl. You may also need the following Open Source utilities:

Obviously, you can ignore the formats that you won’t be using. However, MediaInfo is required no matter what. Moreover, you can easily add support for more formats, as long as you know the right command to decode to standard output and/or encode standard input.

How do you use the script? Easy as pie. Just type

perl replicator.pl input_dir output_dir output_format

For example, on Windows, if you wanted to convert everything under C:\Music into Ogg Vorbis and store the result in C:\Ogg, you’d type

perl replicator.pl "C:/Music" "C:/Ogg" ogg

Mind the forward slashes—even though they’re not strictly necessary. Also, the quotation marks are optional in this case, but you’ll probably be using paths with spaces in them, so just keep them around. Enjoy!

Update: Those of you who downloaded the script before September 5 may want to do so again. Tagging now behaves as it should, and I fixed some other miscellaneous bugs while I was at it.

Post a Comment

This contraption supports Gravatar, as well as Markdown with SmartyPants. If none of that made sense to you, feel free to ignore it and start typing.

  • :)
  • :D
  • ;)
  • :-O
  • :P
  • :@
  • :$
  • :S
  • :(
  • :'(
  • :|
  • :-#
  • 8-|
  • ^o)
  • :-*
  • +o(
  • :^)
  • *-)
  • 8-)
  • |-)
Disorientation
Continuity
Tangentiality
Retributions
Lplayer for the Rest of Us
Tim, PixelPirate
Pidgin to Adium Emoticon Theme Converter
Tom, Tim, peter
The HTC Desire Kicks the HTC Legend’s Ass
Tom, Tim, Tom, Tim, Tim, Tom
Google Chrome Still Sucks
smeezekitty, Tim, milosh
Automating OpenVPN Connection on Windows XP
Tim, Geb, 12vpn, Tim, neecom
Colophonics