OS/2 eZine

16 March 2001
 
John Bijnens is a CAM/CAM engineer in the KHLim - Dep. IWT which is some kind of technical university in Belgium. He gives training in Pro/E and also writes CNC postprocessors (all development is done on OS/2.)

If you have a comment about the content of this article, please feel free to vent in the OS/2 eZine discussion forums.


Previous Article
Home
Next Article



Back Again II for OS/2, Windows 98 and NT


How to automatically convert a CD to a series of MP3 files

One of my colleagues at work is a real Windows fanatic (it ain't good enough if it doesn't carry a Windows trademark). As he regularly plays his own MP3 files and shows off with WinAMP, I was 'stimulated' to search for a good OS/2 alternative and I found one.


What software do you need?

grabber - a grabber is a software package which converts the CD audio tracks to wave-files. An example of such a package which we will also use in this article is leech which also does a good de-jittering job. The result of jittering are the little ticks you hear when you play the resulting wave file from a non-de-jittered grab. A more technical explanation of jittering can be found at http://www.digido.com/jitteressay.html. Other grabbers are Alfons, JCDread2.

MP3 encoder - the software which encodes the wave file into the MP3 format. Examples are bladeenc, L3En4os2, Lame, Gogo. In this article we'll use bladeenc and lame.

cd2mp3pm.exe - the software that acts as the graphical glue between user and the CD grabber and MP3 encoding software.

Additional software

MP3 tag editor - this is an editor to enter song information into the MP3 file. Examples are minta, mymp3, tagtool.

MP3 player - examples of MP3 players on OS/2 are : PM123 and Z!. Both players can also be used as tag editors.

All software mentioned in this article can be downloaded from hobbes: http://hobbes.nmsu.edu

Installation

First of all create a directory to install the software in, e.g. f:\os2\cd2mp3

CD2MP3

The current version of CD2MP3 is 1.13 and is freeware. Unzip cd2mp3pm113.zip into the installation directory, f:\os2\cd2mp3. There is no installation script but you can easily create a program icon on your desktop.

Leech

The current version of Leech is 1.20 and is cardware. Unzip leech120.zip into the installation directory, f:\os2\cd2mp3.

Bladeenc

The current version of Bladeenc is 0.92 and is freeware. As far as I know there are two builds of 0.92 available. One is compiled by Fabrizio Lozada with Borland C++ V2.0. I've tested this build on Warp 4 with fixpack 8 and it run out of heap space. The developer claims it runs on his WSeB. The other one is developed by Tord Jansson and works without any problems on my system.

The file BladeEncOS2-092.zip that you can download from Hobbes is the build of Fabrizio. It is dated 2000/10/19. The file bladeenc2_092.zip that you can download from Hobbes is the build of Tord Jansson. It is dated 2000/03/16. Unzip bladeenc2_092.zip into the installation directory, f:\os2\cd2mp3.

Lame

The current version of Lame is 3.86 and is freeware. There are two packages available from Hobbes : lame386-bare.zip and lame386-full.zip (which contains a Pentium Pro optimized version and support for Ogg Vorbis.) Ogg Vorbis is a new compression format similar to MP3 but developed within the Open Source movement to get rid of license dependent restrictions. More information can be found on www.vorbis.com Download lame386-bare.zip and unzip it into the installation directory, f:\os2\cd2mp3.

Configuration


[Click here to return to small pictures version.]

Start CD2MP3PM by double clicking the icon you've created or by executing cd2mp3pm.exe from the command line.

Configure the CD-ROM drive

Normally CD2MP3PM will automatically recognize your CD-ROM drive and enter the corresponding drive letter in the list box behind Drive: In case the drive is not correctly recognized please select the right drive letter.

Configure the grabber

Now select the grabber software you want to use. In our case this is Leech.

In order for Leech to do its work you must use a CD-ROM drive which supports CD-DA digital transfer. Most CD-ROM drives support this. If you have an older drive this option might not be available. In some cases Leech is not able to detect CD-DA digital transfer capability of the CD-ROM drive. This is because the drive doesn't report this even though it is capable. You must then add an option -o in the configuration file to override capability detection. We will explain in a moment how you can do this.

If you always hear a tick at the beginning of the first song you grab, your CD-ROM drive might not get enough time to spinup to its full speed. You can increase the spinup delay by adding an option -d5 in the configuration file to specify a delay of 5 seconds. Leech defaults to a delay of one second.

The configuration file in which you can add the desired command options is cd2mp3pm.cfg. You can find this file in your installation directory, in our case f:\os2\cd2mp3

Open cd2mp3pm.cfg with a text editor and look for the leech entry. It should look like

# Configuration for Leech

GrabberId       = Leech     # what will show in the dialog
GrabberExe      = Leech.exe # what to execute and where
GrabberType     = VIO       # application type, can be win32os2, vdm or vio
GrabberIn       = "t "      # parameters needed to specify input track number
GrabberOut      =           # parameters needed to specify output filename
GrabberMangling = Track_%.2d.wav  # mangling scheme, put %d or %.nd for track
                            # number, where n is the minimum number of chars
GrabberBefore   =           # other parameters to always use
GrabberAfter    =           # other parameters to always use
GrabberAcceptsOutput = TRUE # TRUE if a custom WAV directory and filename
                            # can be specified.  If TRUE, set
                            # GrabberMangling to what it would react given
                            # "Track" as a name
GrabberNoDrive  = FALSE     # TRUE if parsing the drive letter is a nuisance

If you want to add the two command options we have discussed above change

GrabberBefore   =           # other parameters to always use

into

GrabberBefore   = -o -d5    # other parameters to always use

In case your CD-ROM drive only supports CD-DA if accessed through ASPI, you can use the cdda2wav utility from the cdrecord package which can be downloaded from http://www.geocities.com/SiliconValley/Sector/5785/cdrecord/cdrecordmain.htm

Configure encoder

Now we can select the MP3 encoder software. Click on the MP3 tab in the dialog window of CD2MP3PM. Select the encoder you want to use. In our case this is BladeEnc.

According to the author of CD2MP3PM Samuel Audet, the best MP3 encoder available is lame. If you want to use lame you must add it to the configuration file cd2mp3pm.cfg.

# Configuration for Lame

EncoderId   = Lame
EncoderExe  = Lame.exe
EncoderType = VIO
EncoderIn   =
EncoderOut  =
EncoderLQ   =
EncoderHQ   = -h
EncoderBefore  = -r
EncoderAfter   =
EncoderBitrate = "-b "
EncoderBrMath  = 1
EncoderBrPC    = FALSE
EncoderAcceptsOutput = TRUE

If you now restart cd2mp3pm.exe you will see that Lame is added to the encoder list.

Use

Now we have everything configured, it's time to test it. Place the music CD you want to convert in your CD-ROM drive and start CD2MP3PM by double clicking the icon you've created. Press the refresh button. You then get a result similar to the following figure.

As you can see, the audio tracks are now numbered using the title you have entered after 'CD title'. You can add the 'CD artist' and 'CD category' to add them to the MP3 tags of the different audio tracks when they get converted. You can add the MP3 titles after the conversion to MP3 by using a tag editor or you can use CD2MP3PM.

CD2MP3PM allows you to enter the MP3 tag data like Title, Artist, Year ... manually. To do this place the mouse cursor in e.g. the column Artist and press the left mouse button while holding the alt key down. There is however, a much easier method to get the MP3 tag data filled in and that is by using CDDB. First of all what is CDDB?

CDDB is a free service, started in 1995, by and for music fans to identify the music they were playing on their computers. Every music CD of every artist that you can buy has a unique identification. This identification is used to search the database. There are more than 800,000 albums and 10 million songs in this database. In July 2000 the name of the company was changed from CDDB to Gracenote. More information about CDDB can be found on http://www.gracenote.com/about.html

In order to enable the use of CDDB you must check the option 'Use CDDB'.

Now go to the second page of the tab CD by clicking on the + sign of the tab or by using the popup menu. You can use the menu if you place the mouse cursor just below the coloured tabs but above the line that's on top of the container.

You MUST enter a valid e-mail address in order to connect to a CDDB server. You can check the option 'Try all servers' to automatically try another server when one fails. If you don't check this option the server you've selected will be used. You can also enter the URL of the Proxy you want to use.

As you can see in the figure above, the CDDB servers use ports 888 and 8880. When you are behind a proxy or a firewall it is possible that these ports are blocked. If this is the case you can't connect to a CDDB server. You must then approach the CDDB server by using HTTP which uses port 80. You can specify this by checking the option 'Use HTTP (slower)'. As the option name implies, this connection is a little bit slower due to the HTTP overhead.

Now go back to the first page of the tab CD and click on the Refresh button again. You will now be surprised with the figure you are about to see.

As you can see 'CD artist', 'CD title', 'CD category' are automatically filled in. The track names now contain the track number and the name of the song. All MP3 tag data is automatically filled in.

It is possible to play a song from within CD2MP3PM. You should make sure that your drive is connected to your sound card by using a special cable that is usually delivered together with the drive. Select the track you want to hear and click on the play button.

To explain Super grab I quote the manual :

    While in Super Grab mode, CD2MP3 PM gives the Encoder a priority a bit higher than the Grabber. For example, if you set Low Priority, the Encoder is running at idle class, delta 1, and the Grabber at idle class, delta 0. Without Low Priority, the Encoder is running normal class, delta 1 and the Grabber, normal class, delta 0.

The idea with Super grab is to have a simultaneous grab and encode session.

The entry field 'Temp Dir' has to be filled in. You must specify a directory where you have a lot of free space as this is the directory that will hold the resulting wav files of the grabbed tracks. You can have the grabbed wav files automatically removed after encoding if you enable the option 'Deselect tracks and remove WAV files after encoding' on tab 3.

The entry field 'MP3 directory' has to be filled in. You can enter the directory here in which you want the MP3 files to be stored.

The effect of the option 'High quality' is dependent off the encoder you are using e.g. in the case of BladeEnc this means that the option -hq will be added to the BladeEnc.exe command. As I've found out this option doesn't exist anymore in BladeEnc 0.92 so it has no effect and gives an error. You're free to remove -hq from the configuration file cd2mp3pm.cfg.

Okay. Now you are completely ready to convert the tracks. Go back to tab 1, select the tracks you want to convert and click on the 'Convert' button to start the conversion to MP3.

In case you've made a mistake and you want to stop the conversion, please don't just kill or close the grabber or the encoder. If you do this CD2MP3PM is not always aware of this and may try to continue a job that doesn't exist anymore. Instead of closing or killing click on the 'Stop' button on the CD2MP3PM dialog window.

Instead of grabbing an audio track from CD and converting it to MP3, you can also select your own wav files for conversion. In order to do this go to tab 2 'WAV'.

There are three ways to insert your wav files :

  1. just press the Insert button. A file dialog window appears that lets you select a wav file
  2. insert the wav file into the container by drag & drop
  3. place the mouse cursor in the container and press the right mouse button. A popup menu appears with the option 'Add'.

    If you choose 'Add' a file dialog window appears that lets you select a wav file.

Now select the wav files you want to convert and click on the 'Convert' button.

Additional information

CD2MP3

The current version of CD2MP3 is 1.13. It's freeware with the source code included. The software is written by Samuel Audet who is also one of the authors of probably one of the best MP3 players available on OS/2, namely PM123. Give PM123 a try and if you like it, and I'm sure you will, register it. He can be reached by e-mail at guardia@cam.org. His website is http://www.cam.org/~guardia.

Leech

The current version of Leech is 1.20. It's cardware which means the author would like you to send him a postcard with some comments about Leech. The OS/2 version of Leech is developed by Mads Orbesen Troest.

The address you can send the postcard to is
Mads Orbesen Troest
Dyrskuevej 53, 1.MF
DK-9200 Aalborg SV
Denmark

He can be reached by e-mail at motr96@sprog.auc.dk. His website is http://www.sprog.auc.dk/~motr96.

BladeEnc

The current version of BladeEnc is 0.92. It's freeware. As stated before there are two builds available. One is compiled with Borland C++ 2.0 by Fabrizio Lozada. He can be reached at fabriziolozada@usa.net The other one is build by Tord Jansson who is the current official BladeEnc maintainer. He can be reached by e-mail at tord.jansson@swipnet.se His website is http://bladeenc.mp3.no

Lame

The current version of Lame is 0.93. It's freeware. The OS/2 version of Lame is developed by Nick Burch. He can be reached by e-mail at gagravarr@softhome.net His website is http://users.ox.ac.uk/~magd1113/mpeg/

Don't forget that all this software is written by the authors in their own spare time, so if you like this software, please send a sign of life and your appreciation to the authors and register the software when it is shareware. This way they know their work is valued very much and it will stimulate them to develop new versions.

As the software is written by volunteers in their spare time, they don't own all hardware that is or was available on the market to do very complete testing. So if anything isn't working as expected, don't start to yell, try to provide the authors with a full reproducible error report so they are able to correct the problem in case of a bug.

AND NOW

It is up to you. Give CD2PM3PM a try.

I want to thank Samuel Audet for proofreading this article. He has also notified me of the fact that the CDDB feature isn't working with cddb.org anymore as he don't want to agree with their license. To restore the CDDB features you should add a new server in the CDDB page. At the entry field 'New Server' please enter freecddb.org:8080 and press the left Add button. The new servers will then be added to the list.

Previous Article
Home
Next Article

Copyright (C) 2001. All Rights Reserved.