SoX Wrap
Most of this document is taken from the sox.txt file included in the SoX distribution available from http://sox.sourceforge.net, written by Chris Bagwell, and updated by various authors. It has been slightly edited to remove UNIX-specific instructions and insert a few SoX Wrap-specific instructions.
To use SoX Wrap, first make sure you have installed the included libraries. Then, drag any files you want to convert into the table at the top of the window or use the Add File(s) button. You may drag multiple files, or select multiple files in the Add File dialog.
Most of the time, you won't have to do any more than specify the format you want to convert to and hit Run SoX. The output files will be placed in the same directory as the input file they originate from, but with a new file suffix. The text box will print 'Finished' when the process has finished. You may also specify Verbose Mode, meaning that SoX will print out extra information about what it is doing as it works.
By default, sound files are put into your Users folder. This behavior can be changed by clicking on Define Output Path.
Gives the sample rate in Hertz of the file. To cause the output file to have a different sample rate than the input file, include this option as a part of the output options. If the input and output files have different rates then a sample rate change effect must be ran. If a sample rate changing effect is not specified then a default one will internally be ran by SoX using its default parameters.
Leave the rate fields disabled to have SoX try to detect the rate of the input file and attempt to use the same settings for the output format. If the output format doesn't support these settings, SoX will override them.
This parameter takes a floating point value. Less than 1.0 decreases, greater
than 1.0 increases. May use a negative number to invert the phase of the audio
data. It is interesting to note that we perceive volume logarithmically but
this adjusts the amplitude linearly. As with other format options, the volume
option effects the file its specified with. This is useful whe processing multiple
input files as the volume adjustment can be specified for each input file or
just once to adjust the output file. This can be compared to an audio mixer
were you can control the volume of each input as well as a master volume (output
side).
The sample data encoding is signed linear (2's complement), unsigned linear, u-law (logarithmic), A-law (logarithmic), ADPCM, IMA_ADPCM, GSM, or Floating-point. U-law (actually shorthand for mu-law) and A-law are the U.S. and international standards for logarithmic telephone sound compression. When uncompressed u-law has roughly the precision of 14-bit PCM audio and A-law has roughly the precision of 13-bit PCM audio. A-law and u-law data is sometimes encoded using a reversed bit-ordering (ie. MSB becomes LSB). Internally, SoX understands how to work with this encoding but there is currently no option to specify it. If you need this support then you can use the psuedo file types of ".la" and ".lu" to inform sox of the encoding. See supported file types for more information.
ADPCM is a form of sound compression that has a good compromise between good sound quality and fast encoding/decoding time. It is used for telephone sound compression and places were full fidelity is not as important. When uncompressed it has roughly the precision of 16-bit PCM audio. Popular version of ADPCM include G.726, MS ADPCM, and IMA ADPCM. ADPCM has different meanings in different file handlers. In .wav files it represents MS ADPCM files, in all others it means G.726 ADPCM. IMA ADPCM is a specific form of ADPCM compression, slightly simpler and slightly lower fidelity than Microsoft's flavor of ADPCM. IMA ADPCM is also called DVI ADPCM. GSM is a standard used for telephone sound compression in European countries and its gaining popularity because of its quality. It usually is CPU intensive to work with GSM audio data.
By default, SoX will detect the encoding of the input file and try to use the same settings for the output format. If the output format doesn't support these settings, SoX will override them.
The sample data size is in bytes, 16-bit words, 32-bit long words, or 64-bit
double long (long long) words.
By default, SoX will detect the data size of the input file and try to use the same settings for the output format. If the output format doesn't support these settings, SoX will override them.
The number of sound channels in the data file. This may be 1, 2, or 4; for mono, stereo, or quad sound data. To cause the output file to have a different number of channels than the input file, include this option with the output file options. If the input and output file have a different number of channels then the avg effect must be used. If the avg effect is not specified on the command line it will be invoked internally with default parameters.
Amiga 8SVX musical instrument description format.
AIFF files used on Apple IIc/IIgs and SGI.
Note: the AIFF format supports only one SSND chunk. It does not support multiple sound chunks, or the 8SVX musical instrument description format. AIFF files are multimedia archives and can have multiple audio and picture chunks. You may need a separate archiver to work with them.
SUN Microsystems AU files.
There are apparently many types of .au files; DEC has invented its own with a different magic number and word order. The .au handler can read these files but will not write them. Some .au files have valid AU headers and some do not. The latter are probably original SUN u-law 8000 hz samples. These can be dealt with using the .ul format (see below).
Audio Visual Research
The AVR format is produced by a number of commercial packages on the Mac.
CD-R
CD-R files are used in mastering music on Compact Disks. The audio data on
a CD-R disk is a raw audio file with a format of stereo 16-bit signed samples
at a 44khz sample rate. There is a special blocking/padding oddity at the
end of the audio file and is why it needs its own handler.
Continuously Variable Slope Delta modulation
Used to compress speech audio for applications such as voice mail.
Text Data files
These files contain a textual representation of the sample data. There is
one line at the beginning that contains the sample rate. Subsequent lines
contain two numeric data items: the time since the beginning of the first
sample and the sample value. Values are normalized so that the maximum
and minimum are 1.00 and -1.00. This file format can be used to create
data files for external programs such as FFT analyzers or graph routines.
SoX can also convert a file in this format back into one of the other file
formats.
GSM 06.10 Lossy Speech Compression
A standard for compressing speech which is used in the Global Standard for
Mobil telecommunications (GSM). Its good for its purpose, shrinking audio
data size, but it will introduce lots of noise when a given sound sample
is encoded and decoded multiple times. This format is used by some voice
mail applications. It is rather CPU intensive. GSM in SoX is optional and
requires access to an external GSM library. To see if there is support
for gsm run sox -h and look for it under the list of supported file formats.
Macintosh HCOM files.
These are (apparently) Mac FSSD files with some variant of Huffman compression. The Macintosh has wacky file formats and this format handler apparently doesn't handle all the ones it should. Mac users will need your usual arsenal of file converters to deal with an HCOM file under Unix or DOS.
An Amiga format
An IFF-conform sound file type, registered by MS MacroSystem Computer GmbH,
published along with the "Toccata" sound-card on the Amiga. Allows
8bit linear, 16bit linear, A-Law, u-law in mono and stereo.
MP3 Compressed Audio
MP3 audio files come from the MPEG standards for audio and video compression.
They are a lossy compression format that achieves good compression rates
with a minimum amount of quality loss. Also see Ogg Vorbis for a similar
format.
Null file handler.
This is a fake file hander that act as if its reading a stream of 0's from a while or fake writing output to a file. This is not a very useful file handler in most cases. It might be useful in some scripts were you do not want to read or write from a real file but would like to specify a filename for consistency.
Ogg Vorbis Compressed Audio.
Ogg Vorbis is a open, patent-free CODEC designed for compressing music and
streaming audio. It is similar to MP3, VQF, AAC, and other lossy formats.
SoX can decode all types of Ogg Vorbis files, but can only encode at 128
kbps. Decoding is somewhat CPU intensive and encoding is very CPU intensive.
Psion record.app
Used in some Psion devices for System alarms. This format is newer then the
.wve format that is used in some Psion devices.
IRCAM Sound Files.
Sound Files are used by academic music software such as the CSound package,
and the MixView sound sample editor.
SPHERE (SPeech HEader Resources) is a file format defined by NIST (National
Institute of Standards and Technology) and is used with speech audio. SoX
can read these files when they contain u-law and PCM data. It will ignore
any header information that says the data is compressed using shorten compression
and will treat the data as either u-law or PCM. This will allow SoX and
the command line shorten program to be ran together using pipes to uncompress
the data and then pass the result to SoX for processing.
Turtle Beach SampleVision files.
SMP files are for use with the PC-DOS package SampleVision by Turtle Beach
Softworks. This package is for communication to several MIDI samplers.
All sample rates are supported by the package, although not all are supported
by the samplers themselves. Currently loop points are ignored.
Under DOS this file format is the same as the .sndt format. Under all other
platforms it is the same as the .au format.
SoundTool files.
This is an older DOS file format.
Yamaha TX-16W sampler
A file format from a Yamaha sampling keyboard which wrote IBM-PC format 3.5" floppies.
Handles reading of files which do not have the sample rate field set to one
of the expected by looking at some other bytes in the attack/loop length fields,
and defaulting to 33kHz if the sample rate is still unknown.
More info to come. Used to compress speech audio for applications such as voice mail.
Sound Blaster VOC files.
VOC files are multi-part and contain silence parts, looping, and different
sample rates for different chunks. On input, the silence parts are filled
out, loops are rejected, and sample data with a new sample rate is rejected.
Silence with a different sample rate is generated appropriately. On output,
silence is not detected, nor are impossible sample rates. Note, this version
now supports playing VOC files with multiple blocks and supports playing
files containing u-law and A-law samples.
A headerless file of Dialogic/OKI ADPCM audio data commonly comes with the extension .vox. This ADPCM data has 12-bit precision packed into only 4-bits.
Microsoft .WAV RIFF files
These appear to be very similar to IFF files, but not the same. They are
the native sound file format of Windows. (Obviously, Windows was of such
incredible importance to the computer industry that it just had to have
its own sound file format.) Normally .wav files have all formatting information
in their headers, and so do not need any format options specified for an
input file. If any are, they will override the file header, and you will
be warned to this effect. You had better know what you are doing! Output
format options will
cause a format conversion, and the .wav will written appropriately. SoX
currently can read PCM, ULAW, ALAW, MS ADPCM, and IMA (or DVI) ADPCM. It
can write all of these formats including (NEW!) the ADPCM encoding.
Psion 8-bit A-law
These are 8-bit A-law 8khz sound files used on the Psion palmtop portable
computer.
Raw files (no header)
The sample rate, size (byte, word, etc), and encoding (signed, unsigned,
etc.) of the sample file must be given.
These are several suffices which serve as a shorthand for raw files with a
given size and encoding. Thus, ub, sb, uw, sw, ul, al, lu, la and sl correspond
to "unsigned byte", "signed byte", "unsigned word", "signed
word", "u-law" (byte), "A-law" (byte), inverse
bit order "u-law", inverse bit order "A-law", and "signed
long". The sample rate defaults to 8000 hz if not explicitly set, and
the number of channels defaults to 1. There are lots of Sparc samples floating
around in u-law format with no header and fixed at a sample rate of 8000
hz. (Certain sound management software cheerfully ignores the headers.) Similarly,
most Mac sound files are in unsigned byte format with a sample rate of 11025
or 22050 hz.
Waveform Software is a side project of mine, started when I was a student at the University of Richmond. All the applications are written in Objective-C and Cocoa, and most, though not all, focus on audio and music.
Links to the Mac audio and software world.