Category : C Source Code
Archive   : SOX.ZIP
Filename : SOX.MAN

Output of file : SOX.MAN contained in archive : SOX.ZIP
.de Sh
.ne 5
.de Sp
.if t .sp .5v
.if n .sp
sox - SOund eXchange - universal sound sample translator
.B sox \fIinfile outfile \fB
.B sox \fIinfile outfile \fB[ \fIeffect\fR
.B [ \fIeffect options ...\fB ] ]
.B sox \fIinfile \fB-e \fIeffect\fR
.B [ \fIeffect options ...\fB ]
.B sox
[\fI general options \fB ]
[ \fIformat options \fB ]
[ \fIformat options \fB ]
[ \fIeffect\fR [ \fIeffect options ...\fB ] ]
\fIGeneral options:\fB
[ -V ]
[ -v \fIvolume\fB ]
\fIFormat options:\fB
[ \fB-t \fIfiletype\fB ]
[ -r \fIrate\fB ]
[ -s/-u/-U/-A ]
[ -b/-w/-l/-f/-d/-D ]
[ -c \fIchannels\fB ]
[ -x ]
." .br
." resample
." .br
." check
echo \fIdelay volume\fB [ \fIdelay volume ... \fB]
vibro \fIspeed \fB[ \fIdepth\fB ]
lowp \fIcenter\fB
band \fB[ \fI-n \fB] \fIcenter \fB[ \fIwidth\fB ]
.I Sox
translates sound files from one format to another,
possibly doing a sound effect.
The option syntax is a little grotty, but in essence:
sox file.voc
translates a sound sample in SUN Sparc .AU format
into a SoundBlaster .VOC file, while
sox -v 0.5 -rate 12000 file.voc rate
does the same format translation but also
lowers the amplitude by 1/2 and changes
the sampling rate from 8000 hertz to 12000 hertz via
.B rate
\fIsound effect\fR loop.
File type options:
.TP 10
\fB-t\fI filetype
gives the type of the sound sample file.
.TP 10
\fB-r \fIrate\fR
Give sample rate in Hertz of file.
.TP 10
The sample data is signed linear (2's complement),
unsigned linear, U-law (logarithmic), or A-law (logarithmic).
U-law and A-law are the U.S. and international
standards for logarithmic telephone sound compression.
.TP 10
The sample data is in bytes, 16-bit words, 32-bit longwords,
32-bit floats, 64-bit double floats, or 80-bit IEEE floats.
Floats and double floats are in native machine format.
.TP 10
The sample data is in XINU format; that is,
it comes from a machine with the opposite word order
than yours and must
be swapped according to the word-size given above.
Only 16-bit and 32-bit integer data may be swapped.
Machine-format floating-point data is not portable.
IEEE floats are a fixed, portable format. ???
.TP 10
\fB-c \fIchannels\fR
The number of sound channels in the data file.
This may be 1, 2, or 4; for mono, stereo, or quad sound data.
General options:
.TP 10
after the input file allows you to avoid giving
an output file and just name an effect.
This is only useful with the
.B stat
.TP 10
\fB-v \fIvolume\fR
Change amplitude (floating point);
less than 1.0 decreases, greater than 1.0 increases.
Note: we perceive volume logarithmically, not linearly.
Note: see the
.B stat
.TP 10
Print a description of processing phases.
Useful for figuring out exactly how
.I sox
is mangling your sound samples.
The input and output files may be standard input and output.
This is specified by '-'.
.B -t\ \fItype
option must be given in this case,
.I sox
will not know the format of the given file.
.B -t,
.B -r,
.B -s/-u/-U/-A,
.B -b/-w/-l/-f/-d/-D
.B -x
options refer to the input data when given before the
input file name. After, they refer to the output data.
If you don't give an output file name,
.I sox
will just read the input file.
This is useful for validating structured file formats;
.B stat
effect may also be used
via the
.B -e
.I Sox
needs to know the formats of the input and output files.
File formats which have headers are checked,
if that header doesn't seem right,
the program exits with an appropriate message.
Currently, the raw (no header), IRCAM Sound Files,
Sound Blaster, SPARC .AU (w/header), Mac HCOM,
PC/DOS .SOU, Sndtool, and Sounder, NeXT .SND,
Windows 3.1 RIFF/WAV,
and Amiga/SGI AIFF and 8SVX formats are supported.
.TP 10
.B .aiff
AIFF files used on Amiga 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
and can have multiple audio and picture chunks.
You may need a separate archiver to work with them.
.TP 10
.B .au
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
.B .ul
format (see below).
.TP 10
.B .hcom
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.
.TP 10
.B .raw
Raw files (no header).
The sample rate, size (byte, word, etc),
and style (signed, unsigned, etc.)
of the sample file must be given.
The number of channels defaults to 1.
.TP 10
.B ".ub, .sb, .uw, .sw, .ul"
These are several suffices which serve as
a shorthand for raw files with a given size and style.
Thus, \fBub, sb, uw, sw,\fR and \fBul\fR
correspond to "unsigned byte", "signed byte",
"unsigned word", "signed word", and "ulaw" (byte).
The sample rate defaults to 8000 hz if not explicitly set,
and the number of channels (as always) 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.
.TP 10
.B .sf
IRCAM Sound Files.
SoundFiles are used by academic music software
such as the CSound package, and the MixView sound sample editor.
.TP 10
.B .voc
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.
.TP 10
.B .wav
Windows 3.1 .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 3.1.
Obviously, Windows 3.1 is of such incredible importance
to the computer industry that it just had to have its own
sound file format.
Only one effect from the palette may be applied to a sound sample.
To do multiple effects you'll need to run
.I sox
in a pipeline.
.TP 30
Copy the input file to the output file.
This is the default effect if both files have the same
sampling rate, or the rates are "close".
.TP 30
Translate input sampling rate to output sampling rate
via linear interpolation to the Least Common Multiple
of the two sampling rates.
This is the default effect
if the two files have different sampling rates.
This is fast but noisy.
." Lerp-ing is acceptable for cheap 8-bit sound hardware,
." but for CD-quality sound you should instead use:
." .TP 30
." resample
." Translate input sampling rate to output sampling rate
." via simulated analog filtration.
." This method is slow and uses lots of RAM,
." but gives much better results then
." .B rate.
.TP 30
Mix 4- or 2-channel sound file into 2- or 1-channel file
by averaging the samples for different speakers.
." .TP 30
." check
." Do a format check on the input file,
." and print any errors on the standard error file.
." Write no output.
." If you give no output file,
." you need to specify either this effect or the following:
.TP 30
Do a statistical check on the input file,
and print results on the standard error file.
.B stat
may copy the file untouched from input to output,
if you select an output file.
The "Volume Adjustment:" field in the statistics
gives you the argument to the
.B -v
.I number
which will make the sample as loud as possible.
.TP 30
echo [ \fIdelay volume ... \fB ]
Add echoing to a sound sample.
Each delay/volume pair gives the delay in seconds
and the volume (relative to 1.0) of that echo.
If the volumes add up to more than 1.0,
the sound will melt down instead of fading away.
.TP 30
vibro \fIspeed \fB [ \fIdepth\fB ]
Add the world-famous Fender Vibro-Champ sound
effect to a sound sample by using
a sine wave as the volume knob.
.B Speed
gives the Hertz value of the wave.
This must be under 30.
.B Depth
gives the amount the volume is cut into
by the sine wave,
ranging 0.0 to 1.0 and defaulting to 0.5.
.TP 30
lowp \fIcenter
Apply a low-pass filter.
The frequency response drops logarithmically with
.I center
frequency in the middle of the drop.
The slope of the filter is quite gentle.
.TP 30
band \fB[ \fI-n \fB] \fIcenter \fB[ \fIwidth\fB ]
Apply a band-pass filter.
The frequency response drops logarithmically
around the
.I center
.I width
gives the slope of the drop.
The frequencies at
.I "center + width"
.I "center - width"
will be half of their original amplitudes.
.B Band
defaults to a mode oriented to pitched signals,
i.e. voice, singing, or instrumental music.
.I -n
(for noise) option uses the alternate mode
for un-pitched signals.
.B Band
introduces noise in the shape of the filter,
i.e. peaking at the
.I center
frequency and settling around it.
.I Sox
enforces certain effects.
If the two files have different sampling
rates, the requested effect must be one of
.B copy,
.B rate,
." or
." .B resample.
If the two files have different numbers of channels,
.B avg
." or other channel mixing
effect must be requested.
The syntax is horrific.
It's very tempting to include a default system that allows
an effect name as the program name
and just pipes a sound sample from standard input
to standard output, but the problem of inputting the
sample rates makes this unworkable.
The echoplex effect is:
Copyright (C) 1989 by Jef Poskanzer.

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation. This software is provided "as is" without express or
implied warranty.

  3 Responses to “Category : C Source Code
Archive   : SOX.ZIP
Filename : SOX.MAN

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: