TestMp3

This freeware program scans a directory and its subdirectories for mp3 files.
TestMp3 checks each of these for errors. TestMp3 does NOT change the files in
any way.

I developed TestMp3 after problems transferring Mp3 files to a CDROM. I couldn't
find any way to test if the files on the CDROM were ok. The only softwares I 
found were Mp3Test (which sent so many error messages I couldn't determine which
were really significant) and EncSpot (which gives very useful information but 
not very precise). So I decided to develop my own software. 

After thinking a bit about the problem, I decided to implement my own program. 
This application should display any error found and if there was something 
wrong it must say what is the problem. I used the component TAudioInfo as a 
start point because I already had an occasion to use it before and I knew how 
it worked. 

TestMp3 has been tested on Windows 98, 2000 and XP. It should work on Windows 
95, Windows NT 4 as well as all subsequent versions of Windows.

INSTALLATION:
Unpack the zip file in a temporary directory. The package contains 4 files : 
the executable (TestMp3.exe), the message translation file (TestMp3.msg), this
documentation (TestMp3.txt) and a zip file containing the sources. No other 
file will be created. TestMp3 does not change the Windows registry in any way. 
Only the executable is necessary. You will need the message file only if you 
want to translate TestMp3 to another language than English or if you wish to 
change the text of some messages. You don't need to translate all messages. 
Any non translated message will be displayed in English.

USAGE:
Run the software. Specify the starting directory by typing the full path (do
NOT specify the file mask "*.mp3") or by using the Browse button. Press the
Execute button. During treatment, TestMp3 displays the file being tested in the
status panel at the bottom of the window. Each file is displayed in the Files
list once it is fully tested. The Stop and the Close buttons work during
treatment.

Next to each file name, an icon indicates the test results:
- green = no error was detected
- red bar at the bottom = the last frame is incorrect
- "broken" rectangle = there is at least one synchronization error.
- "broken" rectangle with red bar at the bottom = there is at least one 
  synchronization error and the last frame is incorrect.

For each file, TestMp3 displays the errors found in the right panel.

The "Calculated size" is the position where sound data ends.

The "Real size" is the size the file has on disk, minus the size of the
trailing tags if present. By comparing the "Real size" to the "Calculated
size", TestMp3 tells you how much data is totally is meaningless. Of course, if
you want to keep only the sound data in a Mp3 file, you should remove not only
this "meaningless data" but the Brava software tag, as well as the Id3 tags.

The "Unit" radio group allows to choose dynamically the unit used to display
results (except in the Synchronization errors list). It doesn't affect the way
results would be saved.

The "Sort" radio group allows to choose dynamically the sort order used to
list the files. It does change the the order in which the results would be
saved.

ERROR RECOVERY:
Unfortunately, as far as I know, there isn't much to be done about errors.

You may completely remove the last frame if it is incorrect, thus recovering
some disk space; but if you do so, you may wish to reconstruct the Id3v1 tag
(if there was one originally). In my experience, the size difference is always
less than 1 second; if ever TestMp3 reports a bigger difference, you'd better
check with a mp3 player before.

The only thing that could be done about synchronization errors would be to
remove the incomplete frame. A little tricky and this would perhaps create a
perceptible sound artifact.

TRANSLATION:
I have tried to make TestMp3 adaptable to other languages. Sorry, I didn't do
anything about right-to-left handling, but if some users want me to I will try
to implement it (I will need someone to test it for me). Translation is pretty
easy: just add a new section in the TestMp3.msg file. This file is a plain text
file and it has the structure of a .ini file, you can edit it with NotePad.
Avoid using word processors, most of them put undesirable special characters 
in the file. Comments in the TestMp3.msg file should give you enough 
information to adapt TestMp3 to your language.
Please send me any translation to a new language, so that other users may use it.

FUTURE:
- It would be possible to analyze the Mp3 sound stream itself looking for
coding errors. Frankly, I don't currently feel up to it. This would entail
transcribing to Pascal a horrible C source (I hate C) and extracting from it
the minimum code necessary to detect errors. I don't expect to find much errors
in the sound stream itself, but I may be wrong.
- Once the sound stream is decoded, TestMp3 could try give some sound
information: is the sound low level or on the contrary close to saturation?
- A procedure for excising synchronization errors could be implemented.
- A procedure for removing last frame errors could be implemented.

COMPILING:
In order to recompile TestMp3, you will have to get
- AudioInfo class (c) 1999,2000 Andrey V.Sorokin anso@mail.ru or anso@usa.net, 
  http://anso.da.ru or http://anso.virtualave.net

- BrowseDr TdfsBrowseDirectoryDlg component v2.62 (c) 1999-2001, Brad Stowers. 
  http://www.delphifreestuff.com/

COMPATIBILITY: 
I used Delphi 6 because it is the version I use currently, but I don't see why 
TestMp3 couldn't be ported to older versions of Delphi. To see what would 
happen, I tried to port TestMp3 to Delphi3. Here are the points I had to 
change:
- I had to to remove unused properties (to compensate for anchors, you will have
  to use panels and play with their alignment property until the form behaves
  properly when resizing)
- ListViewEnter may be completely removed, it isn't a major functionality.
- the (listview).Clear instructions may be replaced by (listview).items.clear.

VERSION HISTORY:
1.0.0.0 09 July 2002  	First released version
1.1.0.0 02 August 2002	Bug corrections :
			Unit radio group bug when resizing
			Unit radio group editing didn't refresh values
			Full file name wasn't displayed
			Timing values were incorrect
			One of the hints wasn't translated to french
			Added a few comments in source
			Added immediate Exit
			Corrected bug that happened when TAudioInfo was unable to find the
			  first Mp3 header

Author:    Frederic DA VITORIA
email:     fred_davitor@club-internet.fr
