# mp32dao documentation

## What is it?

mp32dao is a simple perl script designed to help you in the task of creating audio CDs from MP3/Ogg/Flac files. It will decode compressed audio files to wav and create a TOC file suitable for burning with cdrdao.

## Authors

### The beginning and nowadays

The creator of mp32dao is Joe Steward. He had the idea of track padding. It seems he's not maintaining mp32dao anymore, or at least I'm unable to contact him.

My name is Giuseppe Corbelli but I bet you saw it on the very first page of this document ;-). I made some hacking on the original program adding CD-Text and Ogg decoding, and reworking all the script. The original track padding code is still here. You should not think of finding a good programming example, though :-). You can contact me at cowo@lugbs.linux.it.

## Features

### Why you'll love mp32dao

Suppose you have downloaded a bunch of mp3/ogg/flac files. Suppose you want to burn them on a CD, without those annoying clicks between the tracks and with CD-Text support. This is why you're going to use mp32dao.

Samples from the ending of a track are padded together with the beginning of the next to avoid leaving a CD sector half-filled with zeroes. You can avoid clicks between tracks this way.

By using tags in the compressed source files (e.g. ALBUM, AUTHOR, TITLE) mp32dao will generate a toc-file with CD-Text info ready to use with cdrdao. If all the source files do not have the same AUTHOR and ALBUM tags the resulting toc will show "Compilation" as title, and "Various Artists" as author. Cdtext support requires the ALBUM, TITLE and ARTIST tags in all the source files.

## Installation

### Requirements

In order to be able to use mp32dao you must have, installed and working, the following software on your system:

Perl interpreter

- I currently use:

      Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
        Platform:
          osname=linux, osvers=2.4.9-xfs, archname=i686-linux
          uname='linux braveheart.cowo.net 2.4.9-xfs #5
          	\mar ago 21 23:12:16 edt 2001 i686 unknown '
          config_args=''
          hint=recommended, useposix=true, d_sigaction=define
          usethreads=undef use5005threads=undef
          	\useithreads=undef usemultiplicity=undef
          useperlio=undef d_sfio=undef uselargefiles=define
          use64bitint=undef use64bitall=undef
          	\uselongdouble=undef usesocks=undef

  and it works for me. Please note I compiled Perl myself, disabling thread support.

MP3::Info Perl Module

- It is used to access MP3 informations such as playing length, ID3 tags and more.

Ogg::Vorbis Perl Module

- It is used to access Ogg informations such as playing length, comments and more.

Audio::Wav Perl Module

- It is used to access Wav file information such as length.

Audio::Tools::Time Perl Module

- Almost the same as above.

FindBin Perl Module

- It is used to fetch mp32dao.pl location, searching for modules here. You should already have it.

Cwd Perl Module

- It is used to fetch current working directory. You should already have it.

mp3handler.pm, ogghandler.pm, flachandler.pm, MediaHandler.pm, Baseinfo.pm Perl Modules

- They are part of mp32dao distribution. Leave them in the same directory where mp32dao.pl is or install them in the perl search path.

### Installation

You can put the main program file, `mp32dao.pl` anywhere you like. But it expets to find its components in the perl search path or in its same directory. The needed components are:

-     ogghandler.pm

-     mp3handler.pm

-     flachandler.pm

-     MediaHandler.pm

-     BaseInfo.pm

## Usage

### Command line options

The usage is fairly straightforward:

1. put all and only the mp3 and/or ogg and/or flac files you want on the CD in a single directory.

2. change to this directory

3. launch mp32dao.pl [tocfile]. If you specify a tocfile it will be used to write the file .toc used by cdrdao. If you don't `cd.toc` will be used. Other arguments are ignored.

The script should work with all filenames but you'll live happier if you don't name your files like this:

    Iced % Earth - Burning ^ Times - [01].mp3

Avoid stupid naming schemes. Please note the program will compose the CD using the files in the same order as their name suggests. I strongly advise you to put the tracknumber at the beginning of the filename. Example:

    01-The_Quickening.mp3
    02-Heart_Of_Storm.mp3
    03-Sworn_In_The_Metal_Wind.mp3
    04-The_Song_Of_Air.mp3
    05-World_Through_My_Fateless_Eyes.mp3

## Internals

### Program structure

The Mediahandler constructor takes as input a directory name, scans for all supported media files, and returns a list containing handlers for all common operations, such as wav decoding, information access etc. This info is collected by the three lower level modules mp3handler, ogghandler and flachandler using MP3::Info, Ogg::Vorbis and system program metaflac. The main program builds the TOC. In the distribution you will find a simple UML diagram which should make it somewhat clearer.

## The future

### Next release plans

On-the-fly decoding

- No more huge wav files. It should be possible to do the decoding on the fly using a FIFO.

GUI

- Some GUIs using Perl/Tk and/or Perl/GTK.

Binary

- Compile the script to have it available in binary form.

## Troubleshooting

### segfaults and nasty bugs here

There's no point in writing such a section since I develop high quality software :-)).

## Developing

### Wanna help me?

I'm working on mp32dao alone. I always need help and knowledge. Please drop me a mail at cowo@lugbs.linux.it