shithub: sox

Download patch

ref: 466fc1d8846e9acb1868f682e04905f8de883f18
parent: a84236689085cd2f88a4dcad44b5fe344ac1b485
author: robs <robs>
date: Sat Oct 25 16:21:23 EDT 2008

doc updates for recent changes

--- a/AUTHORS
+++ b/AUTHORS
@@ -11,19 +11,20 @@
 		ALSA/OSS/Sun/MacOS X play/record support, initial ADPCM,
 		bugfixes, patch collection and general maintenance.
 	Rob Sykes		robs@users.sourceforge.net
-                FORMATS: M3U, PLS, FLAC, AMR, HTK, WavPack, VOX/IMA/VOC ADPCM
-                support, 24bit support for popular formats, MP3 tags & duration
-                support.
+		FORMATS: M3U, PLS, FLAC, AMR, HTK, WavPack, VOX/IMA/VOC ADPCM
+		support, 24bit support for popular formats, MP3 tags & duration
+		support, .sox native format.
 		EFFECTS: tempo, pad, bass, bend, treble, delay, new reverb, new
 		flanger, soft-knee companding, speed via resampling, filters
 		makeover inc. gnuplot & octave plotting, splice, remix, norm,
 		contrast, new rate, spectrogram, new pitch, riaa, loudness;
-                new effects chain with buffering and any # channels.
-                OTHERS: open input files via URL, file merge, play
-                multiple files with mixed format types, play with replay-gain,
-                building with cmake, much manual improvement and expansion,
+		new effects chain with buffering and any # channels.
+		OTHERS: open input files via URL, file merge, play
+		multiple files with mixed format types, play with replay-gain,
+		building with cmake, much manual improvement and expansion,
 		soxi, improved displays with -S & -V including VU and clips,
-                libSoX examples, various fixes, enhancements and clean-ups.
+		libSoX examples, various fixes, enhancements and clean-ups,
+		multiple input pipes.
 
 Contributors:
 	Reuben Thomas		rrt@sc3d.org
@@ -71,8 +72,8 @@
 		Raw textual data
 	Boisy G. Pitre          boisy@microware.com
 		OS9 port.
-        Sun Microsystems, Guido Van Rossum
-	        CCITT G.711, G.721, G.723 implementation
+	Sun Microsystems, Guido Van Rossum
+		CCITT G.711, G.721, G.723 implementation
 	Graeme Gill		graeme@labtam.labtam.oz.au
 		A-LAW format, Good .WAV handling, avg channel
 		expansion.
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,12 +39,13 @@
 File formats:
 
   o New unfiltered CVSD; supports any bit-rate.  (robs)
+  o New `.sox' native format intended for intermediate files.  (robs)
   o Fix WAV write on 64-bit arch.  (robs)
   o Fix writing PRC ADPCM files.  (Silas Brown)
 
 Effects:
 
-  o N.B. Changed to better default settings for `rate' effect;
+  o N.B. Changed to different default settings for `rate' effect;
     add -s -L options to be compatible with SoX v14.1.0.  (robs)
   o New options for `rate' effect to configure phase response,
     band-width and aliasing.  (robs)
@@ -71,6 +72,8 @@
     multiple effect chains on a single file.  newfile will
     create a new output file when an effect chain terminates.
     Of most use with trim and silence effects. (cbagwell)
+  o Can now use multiple pipes as inputs to the combiner;
+    see `Special Filenames' in sox(1).  (robs)
   o Display SoX build environment information with -V -V.  (robs)
   o Display (with -V) the detected file-type if it differs from the 
     file extension.  (robs)
--- a/sox.1
+++ b/sox.1
@@ -537,7 +537,7 @@
 in place of a normal filename on the command line:
 .TP
 \fB\-\fR
-SoX can be used in pipeline operations by using the special
+SoX can be used in simple pipeline operations by using the special
 filename `\-' which,
 if used in place of an input filename, will cause
 SoX will read audio data from `standard input' (stdin),
@@ -548,7 +548,41 @@
 .B \-t
 below) must also be given.
 .TP
-\fB\-d\fR
+\fB\(dq|\fIprogram \fR[\fIoptions\fR] ...\fB\(dq\fR
+This can be used in place of an input filename to specify the
+the given program's standard output (stdout) be used as an input file.
+Unlike
+.B \-
+(above), this can be used for several inputs to one SoX command.  For
+example, if `genw' generates mono WAV formatted signals to its
+standard output, then the following command makes a stereo file
+from two generated signals:
+.EX
+  sox -M -t wav "|genw --imd -" -t wav "|genw --thd -" out.wav
+.EE
+If
+.B \-t
+is not given then the signal is assumed (and checked) to be in SoX's
+native
+.B .sox
+format (see
+.B \-p
+below and
+.BR soxformat (7)).
+.TP
+\fB\-p\fR, \fB\-\-sox\-pipe\fR
+This can be used in place of an output filename to specify that
+the SoX command should be used as in input pipe to another SoX command.
+For example, the command:
+.EX
+  play "|sox -n -p synth 2" "|sox -n -p synth 2 tremolo 10" stat
+.EE
+plays two `files' in succession, each with different effects.
+.SP
+.B \-p
+is in fact an alias for `\fB\-t sox \-\fR'.
+.TP
+\fB\-d\fR, \fB\-\-default\-device\fR
 This can be used in place of an input or output filename to specify that
 the default audio device (if one has been built into SoX) is to be used.
 This is akin to invoking
@@ -557,7 +591,7 @@
 .B play
 (as described above).
 .TP
-\fB\-n\fR
+\fB\-n\fR, \fB\-\-null\fR
 This can be used in place of an input or output filename to specify that
 a `null file' is to be used.  Note that here, `null file' refers to a
 SoX-specific mechanism and is not related to any operating-system
--- a/soxformat.7
+++ b/soxformat.7
@@ -507,6 +507,21 @@
 .B .u1
 raw format.
 .TP
+.B .sox
+SoX's native uncompressed PCM format, intended for storing (or piping)
+audio at intermediate processing points (i.e. between SoX invocations).
+It has much in common with the popular WAV, AIFF, and AU uncompressed PCM
+formats, but has the following specific characteristics: the PCM samples
+are always stored as 32 bit signed integers, the samples are stored (by
+default) as `native endian', and the number of samples in the file is
+recorded as a 64-bit integer.  Comments are also supported.
+.SP
+See `Special Filenames' in
+.BR sox (1)
+for examples of using the
+.B .sox
+format with `pipes'.
+.TP
 \fBsunau\fR (optional)
 Sun /dev/audio device driver; supports both playing and
 recording audio.  For example:
--- a/src/sox-fmt.c
+++ b/src/sox-fmt.c
@@ -61,7 +61,12 @@
     sox_append_comments(&ft->oob.comments, buf);
     free(buf);
   }
+  
+  /* Consume any bytes after the comments and before the start of the audio
+   * block.  These may include comment padding up to a multiple of 8 bytes,
+   * and further header information that might be defined in future. */
   lsx_seeki(ft, (off_t)(headers_bytes - FIXED_HDR - comments_bytes), SEEK_CUR);
+
   return lsx_check_read_params(
       ft, num_channels, rate, SOX_ENCODING_SIGN2, 32, (off_t)num_samples);
 }