shithub: sox

Download patch

ref: 430ffc96aada94d90a4f95d5b5b52cac9f2dc849
parent: c4ef72a989e0e73ea494b25fe862b306c1eab81f
author: cbagwell <cbagwell>
date: Mon Sep 3 21:58:11 EDT 2001

Updating more docs with new effects and handlers.

--- a/Changelog
+++ b/Changelog
@@ -48,7 +48,7 @@
     to create a test sound CD for testing audio equipment.
   o Ben Last added a new program that uses libst and will merge two
     seperate audio files into a single file with multiple channels.
-    Written for sox 12.16 so doesn't work with 12.17.2 yet.
+    This was merged into the standard sox.c file by cbagwell.
   o Andreas Menke fixed some problems with the speed effect and
     how effects were drained.  Also improved the usage of printf()'s
     to use stderr.
--- a/Makefile.dos
+++ b/Makefile.dos
@@ -17,7 +17,7 @@
 	  wav.obj wve.obj
 
 EOBJ	= avg.obj band.obj bandpass.obj breject.obj btrworth.obj chorus.obj \
-	  compand.obj copy.obj cut.obj dcshift.obj deemphas.obj earwax.o \
+	  compand.obj copy.obj dcshift.obj deemphas.obj earwax.o \
 	  echo.obj echos.obj fade.obj filter.obj flanger.obj highp.obj \
 	  highpass.obj lowp.obj lowpass.obj map.obj mask.obj phaser.obj \
 	  pick.obj pitch.obj pan.obj polyphase.obj rate.obj resample.obj \
--- a/Makefile.gcc
+++ b/Makefile.gcc
@@ -34,7 +34,7 @@
 	  tx16w.o voc.o wav.o wve.o
 
 EOBJ    = avg.o band.o bandpass.o breject.o btrworth.o chorus.o compand.o \
-          copy.o cut.o dcshift.o deemphas.o earwax.o echo.o echos.o fade.o \
+          copy.o dcshift.o deemphas.o earwax.o echo.o echos.o fade.o \
 	  filter.o flanger.o highp.o highpass.o lowp.o lowpass.o map.o \
 	  mask.o pan.o phaser.o pick.o pitch.o polyphas.o rate.o \
 	  resample.o reverb.o reverse.o silence.o speed.o split.o \
--- a/README
+++ b/README
@@ -45,7 +45,7 @@
   o Band-pass filters
   o Band-reject filter
   o Chorus effect
-  o Cut out loop samples
+  o DCShift audio.  Useful to get the best volume adjustments.
   o Move sound stage of CD audio to in front of you (for headphone use)
   o Add an echo 
   o Add a sequence of echos
@@ -64,6 +64,7 @@
      changes using real signal theory!
   o Apply a reverb effect
   o Reverse the sound samples (to search for Satanic messages ;-)
+  o Trim off silence from the beginning of end of a file.
   o Change the speed of samples being played (like speeding up the motor
     on a tape recorder)
   o Convert from mono to stereo
@@ -80,7 +81,7 @@
 This is release 12.17, Patchlevel 2 of the Sound Tools.
 SoX was originally written and maintained by Lance Norskog but
 unfortunetly he has stopped maintaining it since 1995.  I, Chris
-Bagwell (cbagwell@sprynet.com), have started maintaining it since
+Bagwell (cbagwell@users.sourceforge.net), have started maintaining it since
 1996 to the present.
 
 Caveats:
--- a/TODO
+++ b/TODO
@@ -1,5 +1,5 @@
 People are encouraged to pick some of these and implement it.  Send
-all patches to cbagwell@sprynet.com.
+all patches to cbagwell@users.sourceforge.net.
 
   o Add in manual page entries for silence and dcshift.
 
--- a/cut.c
+++ /dev/null
@@ -1,121 +1,0 @@
-
-/*
- * July 5, 1991
- * Copyright 1991 Lance Norskog And Sundry Contributors
- * This source code is freely redistributable and may be used for
- * any purpose.  This copyright notice must be maintained. 
- * Lance Norskog And Sundry Contributors are not responsible for 
- * the consequences of using this software.
- */
-
-/*
- * Sound Tools cut effect file.
- *
- * Pull loop #n from a looped sound file.
- * Not finished, don't use it yet.
- */
-
-#include <math.h>
-#include "st.h"
-
-/* Private data for SKEL file */
-typedef struct cutstuff {
-	int	which;			/* Loop # to pull */
-	int	where;			/* current sample # */
-	ULONG start;			/* first wanted sample */
-	ULONG end;			/* last wanted sample + 1 */
-} *cut_t;
-
-/*
- * Process options
- */
-int st_cut_getopts(effp, n, argv) 
-eff_t effp;
-int n;
-char **argv;
-{
-	cut_t cut = (cut_t) effp->priv;
-
-	/* parse it */
-	cut->which = 0;	/* for now */
-	return (ST_SUCCESS);
-}
-
-/*
- * Prepare processing.
- */
-int st_cut_start(effp)
-eff_t effp;
-{
-	cut_t cut = (cut_t) effp->priv;
-	/* nothing to do */
-
-	cut->where = 0;
-	cut->start = effp->loops[0].start;
-	cut->end = effp->loops[0].start + effp->loops[0].length;
-	return (ST_SUCCESS);
-}
-
-/*
- * Processed signed long samples from ibuf to obuf.
- * Return number of samples processed.
- */
-
-int st_cut_flow(effp, ibuf, obuf, isamp, osamp)
-eff_t effp;
-LONG *ibuf, *obuf;
-LONG *isamp, *osamp;
-{
-	cut_t cut = (cut_t) effp->priv;
-	int len, done;
-	
-	len = ((*isamp > *osamp) ? *osamp : *isamp);
-	if ((cut->where + len <= cut->start) ||
-			(cut->where >= cut->end)) {
-		*isamp = len;
-		*osamp = 0;
-		cut->where += len;
-		return (ST_SUCCESS);
-	}
-	*isamp = len;		/* We will have processed all inputs */
-	if (cut->where < cut->start) {
-		/* skip */
-		ibuf += cut->start - cut->where;
-		len -= cut->start - cut->where;
-	}
-	if (cut->where + len >= cut->end) {
-		/* shorten */
-		len = cut->end - cut->where;
-	}
-	for(done = 0; done < len; done++) {
-		*obuf++ = *ibuf++;
-	}
-	*osamp = len;
-	return (ST_SUCCESS);
-}
-
-/*
- * Drain out remaining samples if the effect generates any.
- */
-
-int st_cut_drain(effp, obuf, osamp)
-eff_t effp;
-LONG *obuf;
-LONG *osamp;
-{
-	*osamp = 0;
-	return (ST_SUCCESS);
-}
-
-/*
- * Do anything required when you stop reading samples.  
- *	(free allocated memory, etc.)
- */
-int st_cut_stop(effp)
-eff_t effp;
-{
-	/* nothing to do */
-    return (ST_SUCCESS);
-}
-
-
--- a/sox.1
+++ b/sox.1
@@ -58,7 +58,7 @@
 .br
     \fBcopy\fR
 .br
-    \fBcut\fR
+    \fBdcshift\fR \fIshift\fR [ \fIlimitergain\fR ]
 .br
     \fBdeemph\fR
 .br
@@ -404,6 +404,13 @@
 Allows 8bit linear, 16bit linear, A-Law, u-law
 in mono and stereo.
 .TP 10
+.B .nul
+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.
+.TP 10
 .B .ogg
 Ogg Vorbis Compressed Audio.
 .br
@@ -696,8 +703,16 @@
 This is the default effect if both files have the same 
 sampling rate.
 .TP 10
-cut \fIloopnumber
-Extract loop #N from a sample.
+dcshift \fIshift\fR [ \fIlimitergain\fR ]
+DC Shift the audio data, with basic linear amplitudate formula.
+This is most useful if your audio data tends to not be centered around
+a value of 0.  Shifting it back will allow you to get the most volume
+adjustments without clipping audio data.
+.br
+The first option is the \fIdcshift\fR value.  It is a floating point number that
+indicates the amount to shift.
+.br
+An option limtergain value can be specified as well.  It should have a value much less then 1.0 and is used only on peaks to prevent clipping.
 .TP 10
 deemph
 Apply a treble attenuation shelving filter to samples in
@@ -1211,6 +1226,6 @@
 .BR soxexam(1)
 .SH NOTICES
 The version of Sox that accompanies this manual page is support by 
-Chris Bagwell (cbagwell@sprynet.com).  Please refer any questions 
+Chris Bagwell (cbagwell@users.sourceforge.net).  Please refer any questions 
 regarding it to this address.  You may obtain the latest version at the 
-the web site http://home.sprynet.com/~cbagwell/sox.html
+the web site http://sox.sourceforge.net/
--- a/sox.txt
+++ b/sox.txt
@@ -34,7 +34,7 @@
 		   in-dB1,out-dB1[,in-dB2,out-dB2...]
 		   [ gain [ initial-volume [ delay ] ] ]
 	   copy
-	   cut
+	   dcshift shift [ limitergain ]
 	   deemph
 	   earwax
 	   echo gain-in gain-out delay decay [ delay decay ... ]
@@ -344,65 +344,75 @@
 		 8bit linear, 16bit linear, A-Law, u-law in  mono
 		 and stereo.
 
+       .nul	 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 consis�
+		 tency.
+
        .ogg	 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
+		 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.  Decod�
-		 ing is somewhat CPU intensive	and  encoding  is
+		 files, but can only encode at 128 kbps.   Decod�
+		 ing  is  somewhat  CPU intensive and encoding is
 		 very CPU intensive.
-		 Ogg  Vorbis  in  sox  is  optional  and requires
+		 Ogg Vorbis  in	 sox  is  optional  and	 requires
 		 access to external Ogg Vorbis libraries.  To see
-		 if  there  is	support for Ogg Vorbis run sox -h
+		 if there is support for Ogg Vorbis  run  sox  -h
 		 and look for it under the list of supported file
 		 formats as "vorbis".
 
        ossdsp	 OSS /dev/dsp device driver
 		 This is a pseudo-file type and can be optionally
-		 compiled into Sox.  Run sox -h	 to  see  if  you
-		 have  support	for  this  file	 type.	When this
-		 driver is used it allows you to open up the  OSS
-		 /dev/dsp  file	 and configure it to use the same
-		 data format as passed in to  /fBSoX.	It  works
-		 for  both  playing  and recording sound samples.
-		 When playing sound files it attempts to  set  up
-		 the  OSS  driver  to  use the same format as the
-		 input file.  It is suggested to always	 override
-		 the  output  values  to  use the highest quality
+		 compiled  into	 Sox.	Run  sox -h to see if you
+		 have support for  this	 file  type.   When  this
+		 driver	 is used it allows you to open up the OSS
+		 /dev/dsp file and configure it to use	the  same
+		 data  format  as  passed in to /fBSoX.	 It works
+		 for both playing and  recording  sound	 samples.
+		 When  playing	sound files it attempts to set up
+		 the OSS driver to use the  same  format  as  the
+		 input	file.  It is suggested to always override
+		 the output values to  use  the	 highest  quality
 		 samples your sound card can handle.  Example: -t
 		 ossdsp -w -s /dev/dsp
 
        .sf	 IRCAM Sound Files.
-		 Sound	Files are used by academic music software
-		 such as the  CSound  package,	and  the  MixView
+		 Sound Files are used by academic music	 software
+		 such  as  the	CSound	package,  and the MixView
 		 sound sample editor.
 
        .sph
-		 SPHERE	 (SPeech HEader Resources) is a file for�
+		 SPHERE (SPeech HEader Resources) is a file  for�
 		 mat defined by NIST (National Institute of Stan�
-		 dards	and  Technology)  and is used with speech
-		 audio.	 SoX can read these files when they  con�
-		 tain  ulaw  and  PCM  data.   It will ignore any
-		 header information that says the  data	 is  com�
-		 pressed using shorten compression and will treat
-		 the data as either ulaw 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.
+		 dards and Technology) and is  used  with  speech
+		 audio.	  SoX can read these files when they con�
+		 tain ulaw 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 ulaw 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  pro�
+		 cessing.
 
        .smp	 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
+		 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.
 
        .snd
-		 Under DOS this file format is the  same  as  the
-		 .sndt	format.	  Under all other platforms it is
+		 Under	DOS  this  file format is the same as the
+		 .sndt format.	Under all other platforms  it  is
 		 the same as the .au format.
 
        .sndt	 SoundTool files.
@@ -410,132 +420,132 @@
 
        sunau	 Sun /dev/audio device driver
 		 This is a pseudo-file type and can be optionally
-		 compiled  into	 Sox.	Run  sox -h to see if you
-		 have support for  this	 file  type.   When  this
-		 driver	 is  used  it allows you to open up a Sun
+		 compiled into Sox.  Run sox -h	 to  see  if  you
+		 have  support	for  this  file	 type.	When this
+		 driver is used it allows you to open  up  a  Sun
 		 /dev/audio file and configure it to use the same
-		 data  type  as	 passed	 in to Sox.  It works for
-		 both playing and recording sound samples.   When
-		 playing  sound	 files	it attempts to set up the
+		 data type as passed in to  Sox.   It  works  for
+		 both  playing and recording sound samples.  When
+		 playing sound files it attempts to  set  up  the
 		 audio driver to use the same format as the input
-		 file.	 It  is	 suggested to always override the
+		 file.	It is suggested to  always  override  the
 		 output values to use the highest quality samples
-		 your  hardware can handle.  Example: -t sunau -w
+		 your hardware can handle.  Example: -t sunau  -w
 		 -s /dev/audio or -t sunau -U -c 1 /dev/audio for
 		 older sun equipment.
 
        .txw	 Yamaha TX-16W sampler.
-		 A  file  format  from a Yamaha sampling keyboard
-		 which wrote IBM-PC format 3.5"	 floppies.   Han�
+		 A file format from a  Yamaha  sampling	 keyboard
+		 which	wrote  IBM-PC format 3.5" floppies.  Han�
 		 dles reading of files which do not have the sam�
-		 ple 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
+		 ple  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.
 
        .vms	 More info to come.
-		 Used  to  compress speech audio for applications
+		 Used to compress speech audio	for  applications
 		 such as voice mail.
 
        .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 gener�
-		 ated appropriately.  On output, silence  is  not
+		 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  gener�
+		 ated  appropriately.	On output, silence is not
 		 detected, nor are impossible sample rates.
 
        vorbis	 See .ogg format.
 
        .wav	 Microsoft .WAV RIFF files.
-		 These	appear	to  be very similar to IFF files,
-		 but not the same.  They  are  the  native  sound
+		 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
+		 of  such  incredible  importance to the computer
+		 industry that it just had to have its own  sound
 		 file format.)	Normally .wav files have all for�
-		 matting  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
+		 matting 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  con�
-		 version,  and	the  .wav  will written appropri�
-		 ately.	 Sox currently can read PCM, ULAW,  ALAW,
-		 MS  ADPCM, and IMA (or DVI) ADPCM.  It can write
+		 Output	 format	 options will cause a format con�
+		 version, and the  .wav	 will  written	appropri�
+		 ately.	  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.
 
        .wve	 Psion 8-bit alaw
-		 These	are  8-bit a-law 8khz sound files used on
+		 These are 8-bit a-law 8khz sound files	 used  on
 		 the Psion palmtop portable computer.
 
        .raw	 Raw files (no header).
-		 The sample rate, size	(byte,	word,  etc),  and
+		 The  sample  rate,  size  (byte, word, etc), and
 		 encoding (signed, unsigned, etc.)  of the sample
-		 file must be  given.	The  number  of	 channels
+		 file  must  be	 given.	  The  number of channels
 		 defaults to 1.
 
        .ub, .sb, .uw, .sw, .ul, .al, .sl
-		 These	are  several  suffices	which  serve as a
-		 shorthand for raw files with a	 given	size  and
-		 encoding.   Thus, ub, sb, uw, sw, ul and sl cor�
-		 respond  to  "unsigned	 byte",	 "signed   byte",
-		 "unsigned  word",  "signed word", "ulaw" (byte),
-		 "alaw" (byte), and "signed  long".   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
+		 These are several  suffices  which  serve  as	a
+		 shorthand  for	 raw  files with a given size and
+		 encoding.  Thus, ub, sb, uw, sw, ul and sl  cor�
+		 respond   to  "unsigned  byte",  "signed  byte",
+		 "unsigned word", "signed word",  "ulaw"  (byte),
+		 "alaw"	 (byte),  and  "signed long".  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 head�
-		 ers.)	 Similarly,  most  Mac sound files are in
+		 ers.)	Similarly, most Mac sound  files  are  in
 		 unsigned byte format with a sample rate of 11025
 		 or 22050 hz.
 
-       .auto	 This  is  a  ``meta-type'': specifying this type
-		 for an input file triggers some code that  tries
-		 to  guess  the	 real  type  by looking for magic
-		 words in the  header.	 If  the  type	can't  be
-		 guessed,  the	program	 exits with an error mes�
-		 sage.	The input must be a  plain  file,  not	a
+       .auto	 This is a ``meta-type'':  specifying  this  type
+		 for  an input file triggers some code that tries
+		 to guess the real  type  by  looking  for  magic
+		 words	in  the	 header.   If  the  type can't be
+		 guessed, the program exits with  an  error  mes�
+		 sage.	 The  input  must  be a plain file, not a
 		 pipe.	This type can't be used for output files.
 
 EFFECTS
        Multiple effects may be applied to the audio data by spec�
-       ifying  them  one  after another at the end of the command
+       ifying them one after another at the end	 of  the  command
        line.
 
        avg [ -l | -r | -f | -b | n,n,...,n ]
-		 Reduce the number of channels by  averaging  the
-		 samples,  or  duplicate channels to increase the
-		 number of channels.  This  effect  is	automati�
-		 cally	used  when  the	 number of input channels
+		 Reduce	 the  number of channels by averaging the
+		 samples, or duplicate channels to  increase  the
+		 number	 of  channels.	 This effect is automati�
+		 cally used when the  number  of  input	 channels
 		 differ from the number of output channels.  When
-		 reducing  the	number of channels it is possible
-		 to manually specify the avg effect and	 use  the
-		 -l,  -r,  -f,	or  -b options to select only the
-		 left, right, front, or back channel(s)	 for  the
-		 output	 instead  of averaging the channels.  The
-		 -f and -b  options  maintain  left/right  stereo
+		 reducing the number of channels it  is	 possible
+		 to  manually  specify the avg effect and use the
+		 -l, -r, -f, or -b options  to	select	only  the
+		 left,	right,	front, or back channel(s) for the
+		 output instead of averaging the  channels.   The
+		 -f  and  -b  options  maintain left/right stereo
 		 separation; use the avg effect twice to select a
 		 single channel.
 
 		 The avg effect can also be invoked with up to 16
 		 double-precision numbers, which specify the pro�
-		 portion of each input	channel	 that  is  to  be
-		 mixed	into each output channel.  In two-channel
+		 portion  of  each  input  channel  that is to be
+		 mixed into each output channel.  In  two-channel
 		 mode, 4 numbers are given: l->l, l->r, r->l, and
-		 r->r,	respectively.	In four-channel mode, the
-		 first 4 numbers give  the  proportions	 for  the
-		 left-front  output  channel, as follows: lf->lf,
+		 r->r, respectively.  In four-channel  mode,  the
+		 first	4  numbers  give  the proportions for the
+		 left-front output channel, as	follows:  lf->lf,
 		 rf->lf, lb->lf, and rb->rf.  The next 4 give the
 		 right-front output in the same order, then left-
 		 back and right-back.
 
-		 It is also possible to use  the  16  numbers  to
+		 It  is	 also  possible	 to use the 16 numbers to
 		 expand or reduce the channel count; just specify
 		 0 for unused channels.	 Finally, if fewer than 4
 		 numbers are given, certain special abbreviations
@@ -542,24 +552,24 @@
 		 may be invoked; see the source code for details.
 
        band [ -n ] center [ width ]
-		 Apply	 a   band-pass	 filter.   The	frequency
+		 Apply	a  band-pass   filter.	  The	frequency
 		 response drops logarithmically around the center
-		 frequency.   The  width  gives	 the slope of the
-		 drop.	The frequencies at  center  +  width  and
-		 center	 -  width  will be half of their original
+		 frequency.  The width gives  the  slope  of  the
+		 drop.	 The  frequencies  at  center + width and
+		 center - width will be half  of  their	 original
 		 amplitudes.  Band defaults to a mode oriented to
 		 pitched signals, i.e. voice, singing, or instru�
-		 mental music.	The -n (for  noise)  option  uses
-		 the   alternate  mode	for  un-pitched	 signals.
-		 Warning: -n introduces	 a  power-gain	of  about
-		 11dB  in  the	filter, so beware of output clip�
+		 mental	 music.	  The  -n (for noise) option uses
+		 the  alternate	 mode  for  un-pitched	 signals.
+		 Warning:  -n  introduces  a  power-gain of about
+		 11dB in the filter, so beware	of  output  clip�
 		 ping.	Band introduces noise in the shape of the
 		 filter, i.e. peaking at the center frequency and
-		 settling around it.  See filter for  a	 bandpass
+		 settling  around  it.	See filter for a bandpass
 		 effect with steeper shoulders.
 
        bandpass frequency bandwidth
-		 Butterworth  bandpass filter. Description coming
+		 Butterworth bandpass filter. Description  coming
 		 soon!
 
        bandreject frequency bandwidth
@@ -569,10 +579,10 @@
        chorus gain-in gain-out delay decay speed depth
 
 	      -s | -t [ delay decay speed depth -s | -t ... ]
-		 Add  a chorus to a sound sample.  Each quadtuple
-		 delay/decay/speed/depth gives the delay in  mil�
-		 liseconds  and	 the  decay (relative to gain-in)
-		 with a modulation speed in  Hz	 using	depth  in
+		 Add a chorus to a sound sample.  Each	quadtuple
+		 delay/decay/speed/depth  gives the delay in mil�
+		 liseconds and the decay  (relative  to	 gain-in)
+		 with  a  modulation  speed  in Hz using depth in
 		 milliseconds.	The modulation is either sinodial
 		 (-s) or triangular (-t).  Gain-out is the volume
 		 of the output.
@@ -582,55 +592,66 @@
 	       in-dB1,out-dB1[,in-dB2,out-dB2...]
 
 	       [gain [initial-volume [delay ] ] ]
-		 Compand  (compress  or expand) the dynamic range
-		 of a sample.  The attack and decay time  specify
-		 the  integration  time	 over  which the absolute
-		 value of  the	input  signal  is  integrated  to
+		 Compand (compress or expand) the  dynamic  range
+		 of  a sample.	The attack and decay time specify
+		 the integration time  over  which  the	 absolute
+		 value	of  the	 input	signal	is  integrated to
 		 determine its volume; attacks refer to increases
-		 in volume and decays refer to decreases.   Where
-		 more  than  one  pair of attack/decay parameters
-		 are specified, each  channel  is  treated  sepa�
-		 rately	 and  the number of pairs must agree with
-		 the  number  of  input	 channels.   The   second
-		 parameter is a list of points on the compander's
-		 transfer function specified in	 dB  relative  to
+		 in  volume and decays refer to decreases.  Where
+		 more than one pair  of	 attack/decay  parameters
+		 are  specified,  each	channel	 is treated sepa�
+		 rately and the number of pairs must  agree  with
+		 the number of input channels.	The second param�
+		 eter is a list	 of  points  on	 the  compander's
+		 transfer  function  specified	in dB relative to
 		 the  maximum  possible	 signal	 amplitude.   The
-		 input values must be in  a  strictly  increasing
+		 input	values	must  be in a strictly increasing
 		 order but the transfer function does not have to
 		 be monotonically rising.  The special value -inf
-		 may  be  used	to indicate that the input volume
-		 should be associated output volume.  The  points
+		 may be used to indicate that  the  input  volume
+		 should	 be associated output volume.  The points
 		 -inf,-inf and 0,0 are assumed; the latter may be
 		 overridden, but the former may not.
 
 		 The third (optional) parameter is a postprocess�
-		 ing  gain  in dB which is applied after the com�
-		 pression has taken place; the fourth  (optional)
+		 ing gain in dB which is applied after	the  com�
+		 pression  has taken place; the fourth (optional)
 		 parameter is an initial volume to be assumed for
-		 each channel when the effect starts.  This  per�
-		 mits  the  user  to  supply a nominal level ini�
-		 tially, so that, for example, a very large  gain
-		 is  not  applied to initial signal levels before
-		 the companding action has begun to  operate:  it
-		 is  quite  probable  that  in such an event, the
-		 output would be severely clipped while the  com�
+		 each  channel when the effect starts.	This per�
+		 mits the user to supply  a  nominal  level  ini�
+		 tially,  so that, for example, a very large gain
+		 is not applied to initial signal  levels  before
+		 the  companding  action has begun to operate: it
+		 is quite probable that in  such  an  event,  the
+		 output	 would be severely clipped while the com�
 		 pander gain properly adjusts itself.
 
-		 The  fifth  (optional)	 parameter  is a delay in
-		 seconds.  The input signal is	analyzed  immedi�
+		 The fifth (optional) parameter	 is  a	delay  in
+		 seconds.   The	 input signal is analyzed immedi�
 		 ately	to  control  the  compander,  but  it  is
 		 delayed before being fed to the volume adjuster.
-		 Specifying  a	delay  approximately equal to the
-		 attack/decay  times  allows  the  compander   to
-		 effectively  operate  in  a  "predictive" rather
+		 Specifying a delay approximately  equal  to  the
+		 attack/decay	times  allows  the  compander  to
+		 effectively operate  in  a  "predictive"  rather
 		 than a reactive mode.
 
        copy	 Copy the input file to the output file.  This is
-		 the  default  effect if both files have the same
+		 the default effect if both files have	the  same
 		 sampling rate.
 
-       cut loopnumber
-		 Extract loop #N from a sample.
+       dcshift shift [ limitergain ]
+		 DC  Shift  the	 audio	data,  with  basic linear
+		 amplitudate formula.  This  is	 most  useful  if
+		 your  audio data tends to not be centered around
+		 a value of 0.	Shifting it back will  allow  you
+		 to get the most volume adjustments without clip�
+		 ping audio data.
+		 The first option is the dcshift value.	 It is	a
+		 floating  point number that indicates the amount
+		 to shift.
+		 An option limtergain value can be  specified  as
+		 well.	It should have a value much less then 1.0
+		 and is used only on peaks to prevent clipping.
 
        deemph	 Apply a treble attenuation  shelving  filter  to
 		 samples  in  audio  cd	 format.   The	frequency
@@ -834,12 +855,12 @@
        rate	 Translate input sampling rate to output sampling
 		 rate  via linear interpolation to the Least Com�
 		 mon Multiple of the two sampling rates.  This is
-		 the default effect if the two files have differ�
-		 ent sampling rates and the preview  options  was
-		 specified.  This is fast but noisy: the spectrum
-		 of the original sound will  be	 shifted  upwards
-		 and  duplicated faintly when up-translating by a
-		 multiple.
+		 the   default	effect	if  the	 two  files  have
+		 different sampling rates and the preview options
+		 was  specified.   This	 is  fast  but noisy: the
+		 spectrum of the original sound will  be  shifted
+		 upwards and duplicated faintly when up-translat�
+		 ing by a multiple.
 
 		 Lerp-ing is acceptable	 for  cheap  8-bit  sound
 		 hardware,  but	 for  CD-quality sound you should
@@ -1177,10 +1198,10 @@
 
 NOTICES
        The version of Sox that accompanies this	 manual	 page  is
-       support	by  Chris Bagwell (cbagwell@sprynet.com).  Please
-       refer any questions regarding it to this address.  You may
-       obtain	the   latest   version	 at   the  the	web  site
-       http://home.sprynet.com/~cbagwell/sox.html
+       support by Chris Bagwell (cbagwell@users.sourceforge.net).
+       Please refer any questions regarding it to  this	 address.
+       You  may	 obtain	 the  latest  version at the the web site
+       http://sox.sourceforge.net/
 
 
 
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -48,7 +48,7 @@
 	  wav.o wve.o
 
 EOBJ	= avg.o band.o bandpass.o breject.o btrworth.o chorus.o compand.o \
-	  copy.o cut.o dcshift.o deemphas.o earwax.o echo.o echos.o \
+	  copy.o dcshift.o deemphas.o earwax.o echo.o echos.o \
 	  fade.o filter.o flanger.o highp.o highpass.o lowp.o lowpass.o \
 	  map.o mask.o pan.o phaser.o pick.o pitch.o polyphas.o \
 	  rate.o resample.o reverb.o reverse.o silence.o speed.o split.o \
--- a/src/dcshift.c
+++ b/src/dcshift.c
@@ -30,12 +30,9 @@
 #define ONE	  ((DCSHIFT_FLOAT)(1.0e0))
 #define TWENTY	  ((DCSHIFT_FLOAT)(20.0e0))
 
-#define DCSHIFT_USAGE "Usage: dcshift shift [ limitergain ]"
-// The following is dieing on a solaris gcc 2.8.1 compiler!?!!
-#if 0
-#define DCSHIFT_USAGE2 " The peak limiter has a gain much less than 1.0 (ie 0.05 or 0.02) which is only"
-#define DCSHIFT_USAGE3 " used on peaks to prevent clipping. (default is no limiter)"
-#endif
+#define DCSHIFT_USAGE "Usage: dcshift shift [ limitergain ]\n" \
+"The peak limiter has a gain much less than 1.0 (ie 0.05 or 0.02) which is only\n" \
+"used on peaks to prevent clipping. (default is no limiter)"
 
 typedef struct {
     DCSHIFT_FLOAT dcshift; /* DC shift. */
@@ -60,7 +57,13 @@
     dcs_t dcs = (dcs_t) effp->priv; 
     dcs->dcshift = ONE; /* default is no change */
     dcs->uselimiter = 0; /* default is no limiter */
-    
+  
+    if (n < 1)
+    {
+	st_fail(DCSHIFT_USAGE);
+	return ST_EOF;
+    }
+
     if (n && (!sscanf(argv[0], DCSHIFT_FLOAT_SCAN, &dcs->dcshift)))
     {
 	st_fail(DCSHIFT_USAGE);
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -529,11 +529,6 @@
 extern int st_copy_flow();
 extern int st_copy_stop();
 
-extern int st_cut_getopts();
-extern int st_cut_start();
-extern int st_cut_flow();
-extern int st_cut_stop();
-
 extern int st_dcshift_getopts();
 extern int st_dcshift_start();
 extern int st_dcshift_flow();
@@ -741,9 +736,6 @@
 		st_compand_drain, st_compand_stop},
 	{"copy", ST_EFF_MCHAN, 
 		st_copy_getopts, st_copy_start, st_copy_flow, 
-		st_null_drain, st_nothing},
-	{"cut", ST_EFF_MCHAN, 
-		st_cut_getopts, st_cut_start, st_cut_flow, 
 		st_null_drain, st_nothing},
 	{"dcshift", ST_EFF_MCHAN, 
 		st_dcshift_getopts, st_dcshift_start, st_dcshift_flow, 
--- a/src/play.in
+++ b/src/play.in
@@ -65,7 +65,7 @@
 # loop over arguments
 while [ $# -ne 0 ]; do
     case "$1" in
-	avg|band|bandpass|bandreject|chorus|compand|copy|cut|deemph|earwax|echo|echos|fade|filter|flanger|highp|highpass|lowp|lowpass|map|mask|pan|phaser|pick|pitch|polyphase|rate|resample|reverb|reverse|speed|split|stat|stretch|swap|trim|vibro|vol)
+	avg|band|bandpass|bandreject|chorus|compand|copy|cut|deemph|earwax|echo|echos|fade|filter|flanger|highp|highpass|lowp|lowpass|map|mask|pan|phaser|pick|pitch|polyphase|rate|resample|reverb|reverse|silence|speed|split|stat|stretch|swap|trim|vibro|vol)
 	    effects="$@"
 	    break
 	    ;;
--- a/src/sox.c
+++ b/src/sox.c
@@ -523,6 +523,7 @@
 	}
 }
 
+#ifdef SOXMIX
 static int compare_input(ft_t ft1, ft_t ft2)
 {
     if (ft1->info.rate != ft2->info.rate)
@@ -536,6 +537,7 @@
 
     return ST_SUCCESS;
 }
+#endif
 
 /* 
  * Process input file -> effect table -> output file