shithub: sox

Download patch

ref: 0ac9f7f715bc5740ba06adcfc69eadf2f85457b1
parent: dc1f38663112c22f5d16e060d56fc361d790bd44
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Jan 28 19:47:28 EST 2013

Don't use removed options in examples

Replace removed options -s, -U, -i and -2 in the man pages and example
scripts.

--- a/scripts/alert.sh
+++ b/scripts/alert.sh
@@ -13,7 +13,7 @@
 # If you run this script, you may want to hit Ctrl-C fairly soon after the
 # alert tone starts playing---it's not a pleasant sound!
 
-# The synth effect is used to generate each of the tones; "-U -r 8000"
+# The synth effect is used to generate each of the tones; "-e mu-law -r 8000"
 # selects u-law 8kHz sampling-rate audio (i.e. relatively low fidelity,
 # suitable for the marine radio transmission channel); each tone is
 # generated at a length of 0.25 seconds to give the required 4Hz
@@ -30,7 +30,7 @@
 rm -f 2tones.ul    # Make sure we append to a file that's initially empty
 
 for freq in 1300 2100; do
-  $SOX -U -r 8000 -n -t raw - synth 0.25 sine $freq gain -3 >> 2tones.ul
+  $SOX -e mu-law -r 8000 -n -t raw - synth 0.25 sine $freq gain -3 >> 2tones.ul
 done
 
 rm -f alert.ul     # Make sure we append to a file that's initially empty
--- a/scripts/crossfade.sh
+++ b/scripts/crossfade.sh
@@ -80,7 +80,7 @@
 
 # Get crossfade section from first file and optionally do the fade out
 echo "Obtaining $fade_length seconds of fade out portion from $first_file..."
-$SOX "$first_file" -s -b 16 fadeout1.wav trim $trim_length $fade_first_opts
+$SOX "$first_file" -e signed-integer -b 16 fadeout1.wav trim $trim_length $fade_first_opts
 
 # When user specifies "auto" try to guess if a fadeout is needed.
 # "RMS amplitude" from the stat effect is effectively an average
@@ -102,7 +102,7 @@
 
 # Get the crossfade section from the second file and optionally do the fade in
 echo "Obtaining $fade_length seconds of fade in portion from $second_file..."
-$SOX "$second_file" -s -b 16 fadein1.wav trim 0 $fade_length
+$SOX "$second_file" -e signed-integer -b 16 fadein1.wav trim 0 $fade_length
 
 # For auto, do similar thing as for fadeout.
 if [ "$fade_second" == "auto" ]; then
@@ -128,8 +128,8 @@
 
 echo "Trimming off crossfade sections from original files..."
 
-$SOX "$first_file" -s -b 16 song1.wav trim 0 $trim_length
-$SOX "$second_file" -s -b 16 song2.wav trim $fade_length
+$SOX "$first_file" -e signed-integer -b 16 song1.wav trim 0 $trim_length
+$SOX "$second_file" -e signed-integer -b 16 song2.wav trim $fade_length
 
 echo "Creating crossfade files"
 $SOX song1.wav crossfade1.wav "cfo_${first_file}.wav"
--- a/scripts/crossfade_cat.sh
+++ b/scripts/crossfade_cat.sh
@@ -73,7 +73,7 @@
 
 # Get crossfade section from first file and optionally do the fade out
 echo "Obtaining $fade_length seconds of fade out portion from $first_file..."
-$SOX "$first_file" -s -b 16 fadeout1.wav trim $trim_length
+$SOX "$first_file" -e signed-integer -b 16 fadeout1.wav trim $trim_length
 
 # When user specifies "auto" try to guess if a fadeout is needed.
 # "RMS amplitude" from the stat effect is effectively an average
@@ -95,7 +95,7 @@
 
 # Get the crossfade section from the second file and optionally do the fade in
 echo "Obtaining $fade_length seconds of fade in portion from $second_file..."
-$SOX "$second_file" -s -b 16 fadein1.wav trim 0 $fade_length
+$SOX "$second_file" -e signed-integer -b 16 fadein1.wav trim 0 $fade_length
 
 # For auto, do similar thing as for fadeout.
 if [ "$fade_second" == "auto" ]; then
@@ -117,8 +117,8 @@
 
 echo "Trimming off crossfade sections from original files..."
 
-$SOX "$first_file" -s -b 16 song1.wav trim 0 $trim_length
-$SOX "$second_file" -s -b 16 song2.wav trim $fade_length
+$SOX "$first_file" -e signed-integer -b 16 song1.wav trim 0 $trim_length
+$SOX "$second_file" -e signed-integer -b 16 song2.wav trim $fade_length
 $SOX song1.wav crossfade.wav song2.wav mix.wav
 
 echo -e "Removing temporary files...\n" 
--- a/scripts/testcd.sh
+++ b/scripts/testcd.sh
@@ -42,7 +42,7 @@
     PRE=$1;
 fi
 # 2 channel 16 bit signed linear int with CD sampling rate
-SOXOPT="-c 2 -r 44100 -s -b 16 -n"
+SOXOPT="-c 2 -r 44100 -e signed-integer -b 16 -n"
 
 # file with list of filenames
 LST="${PRE}.lst"
--- a/sox.1
+++ b/sox.1
@@ -137,7 +137,8 @@
 records a new track in a multi-track recording.  Finally,
 .EX
 .ne 3
-   rec \-r 44100 \-b 16 \-s \-p silence 1 0.50 0.1% 1 10:00 0.1% | \\
+   rec \-r 44100 \-b 16 \-e signed-integer \-p \\
+	silence 1 0.50 0.1% 1 10:00 0.1% | \\
 	sox \-p song.ogg silence 1 0.50 0.1% 1 2.0 0.1% : \\
 	newfile : restart
 .EE
--- a/soxformat.7
+++ b/soxformat.7
@@ -148,7 +148,7 @@
 	sox infile \-t alsa
 	sox infile \-t alsa default
 	sox infile \-t alsa plughw:0,0
-	sox \-2 \-t alsa hw:1 outfile
+	sox \-b 16 \-t alsa hw:1 outfile
 .EE
 See also
 .BR play (1),
@@ -501,7 +501,7 @@
 .EX
 	sox infile \-t oss
 	sox infile \-t oss /dev/dsp
-	sox \-2 \-t oss /dev/dsp outfile
+	sox \-b 16 \-t oss /dev/dsp outfile
 .EE
 See also
 .BR play (1),
@@ -534,7 +534,7 @@
 Psion Record. Used in Psion EPOC PDAs (Series 5, Revo and similar) for
 System alarms and recordings made by the built-in Record application.
 When writing, SoX defaults to A-law, which is recommended; if you must
-use ADPCM, then use the \fB\-i\fR switch. The sound quality is poor
+use ADPCM, then use the \fB\-e ima-adpcm\fR switch. The sound quality is poor
 because Psion Record seems to insist on frames of 800 samples or
 fewer, so that the ADPCM CODEC has to be reset at every 800 frames,
 which causes the sound to glitch every tenth of a second.
@@ -651,7 +651,7 @@
 .EE
 or
 .EX
-	sox infile \-t sunau \-U \-c 1 /dev/audio
+	sox infile \-t sunau \-e mu-law \-c 1 /dev/audio
 .EE
 for older sun equipment.
 .SP
@@ -774,7 +774,7 @@
 The most common use of this file-type is likely to be along the following
 lines:
 .EX
-	sox infile.any \-t wavpcm \-s outfile.wav
+	sox infile.any \-t wavpcm \-e signed-integer outfile.wav
 .EE
 .TP
 \&\fB.wv\fR (optional)