Playlist Maker Program

by Jim Chapman
[ Home | Where we live | Jim | Isabel | James | Edward | Nicholas ]

This is a program for constructing playlists (i.e. M3U files). I have found it useful, to let me play my MP3 collection on a variety of devices, including:

  • My Squeezebox (a very cool piece of kit - buy one at once!)
  • Windows Media Player
  • It figures out what playlists you want, by assuming that all the MP3 files stored in a directory together belong in the same album (or whatever) and building a playlist accordingly. It assumes that the files should be played in the order that they were recorded (does any ripper not record files in track order?).

    This program requires the .NET Framework to be installed on the computer you're running it on. If you haven't already installed the framework, go to to do so.

    This program should be run from a console window.

    If there is a command line argument, it should be the name of a directory. The program will use that directory as its base directory. If there is no command line argument, the program's base directory will be the console window's current directory.

    The program (like it says on the label) makes playlists. That is to say it traverses the base directory and the entire directory tree below it, looking for MP3 files. For every directory it finds which contains MP3 files, it builds a M3U (playlist) file listing the names of all those MP3 files, in the order of their last-modified dates/times. Actually, it builds two files - one, it places in the base directory, and the other it places in the same directory as the MP3 files. The names of the playlist files begin with "!_PLAY", and then consist of the names of all intermediate directories between the base directory and the MP3 file directory, concatenated together and separated by "_" characters.

    This behaviour is simpler than it sounds. Run the program on a directory structure containg some MP3 files, and the results will make it clear what is going on.

    The source file contains further explanations.

    If you want to run the program, or see the un-HTML-ised source code, you will need to download the ZIP archive.

    Feel free to mess with or reuse any part of the code, subject to the conditions of the GPL. If you infringe those, giant zombie coypus will creep up on you in the dark of the night and gnaw your private parts. You might also get sued by the Free Software Foundation.