A-B test audio comparison program
(C) 2000, Mike Ingle (inglem@dslinks.com or mikeingle@delphi.com)
This program is in the public domain.

ABTEST is a utility for comparing sound files. It plays WAV files, and lets
you switch between them while they are playing. This makes it easy to hear
the effects of MP3 encoding or other processing.

For example, encode a WAV file called "before.wav" into "128.mp3" at 128K,
and into "256.mp3" at 256K. Then decode them back to "128.wav" and "256.wav".
Using Winamp, you can decode by choosing Options/Preferences, Output tab,
and setting the Output Device to WAV File Output.

Run ABTEST from the command prompt like this:
C:\MP3>abtest before.wav 128.wav 256.wav

The music starts playing. Hit A to hear "before.wav", B to hear "128.wav",
and C to hear "256.wav". There is no interruption in the music when you
switch versions. You can easily hear any degradation produced by the encoder.

All the input files must have the same sampling rate (KHz), bits per sample
(8 or 16), and mono or stereo setting. To prevent interruptions in the sound,
ABTEST does not close the audio port or interrupt the data flow when you
switch files, so it cannot reset the playback parameters. 

(Run ABTEST with no file names to get this help)
Usage: abtest wavfile1 wavfile2 [-ib inbufsize] [-ob outbufsize]
  A-Z or 1-9 to select input file during playback
  [ Back 10 seconds        (no shift key)
  ] Forward 10 seconds     (no shift key)
  { Back 30 seconds        (with shift key)
  } Forward 30 seconds     (with shift key)
  . Pause/resume
  ESC exit

How the program works:
The program opens all the files and reads them in large (1MB default) chunks
into input buffers. There are two input buffers for each file. It copies in
small chunks (8K-64K depending on sample rate) into two alternating output
buffers as the music plays. When you switch sources, the program just changes
which of the input buffers it copies from into the output buffers. It always
reads all the input files.

-------

Most of the time you will never have to change the settings below.

You can set the input buffer size to 256K (262144), 512K (524288) or 1024K
(1048576) with the -ib option. If you have limited memory, making it smaller
might help. Make it too small, and open too many files, and the hard drive
might not be able to keep up.

You can set the output buffer to 8192, 16384, 32768, or 65536 bytes with the
-ob option. Making it smaller reduces the (sub-second) delay when you switch
sources. Making it too small causes clicks or interruptions in the sound.
