ref: 2ac9477a08faf867d002d80cf7cf1c1206935200
parent: 81e2aac1c3558b50ac82bba683070b82c35ae9dc
author: cbagwell <cbagwell>
date: Tue Jun 8 23:07:29 EDT 1999
Updated play scripts and fixed aiff comments
--- a/CHEAT
+++ b/CHEAT
@@ -101,5 +101,10 @@
when reading u-law data and writing back out u-law data. If possible,
specify the output data to be uncompressed PCM.
+Under DOS, you can convert several using something similar to the
+following command line:
+
+FOR %X IN (*.RAW) DO sox -r 11025 -w -s -t raw $X $X.wav
+
Good luck!
--- a/Changelog
+++ b/Changelog
@@ -12,7 +12,7 @@
Got code ready to tweak speed more which also forced me to clean up
Endian test code.
o Fixed a bug in .au's handling of G.723. It wasn't using the correct
- number of bits.
+ number of bits. Added A-law support to .au.
o Quoted $filename in play/rec scripts so that files with spaces in
their names can be given.
o Old OS/2 support didn't work. Replaced with known working EMX
@@ -30,17 +30,20 @@
effect on STDIN and output the results to STDOUT.
o Fixed up some makefiles and 16-bit support from patches sent by
Mark Morgan Lloyd (markMLl.in@telemetry.co.uk). Also added some
- nice DOS test bat files from him as well. They only work with
- an advanced setup like 4DOS or some such thing.
+ nice DOS test bat files from him as well.
o Cleaned up some more cross-platform compile problems. In the process
got it working with Turbo C again, kinda. It still locks DOS up at times.
o Made AIFF handler work with invalid headers that some programs generate.
- Also fix an Endian bug thats been there for quick a long time (when
- ran on Intel machines).
+ Also fix an Endian bug thats been there for quite a long time (when
+ ran on Intel machines). Made comment lengths even length to make
+ most MacOS programs happy. cbagwell
o Resample function was updated by Andreas Wilde
(andreas@eakaw2.et.tu-dresden.de) to fix problem were freqs. were
off by a factor of 2.
o Added an effect that swaps stereo channels. cbagwell
+ o Combined play and rec scripts to a single program to ease mantaince.
+ Also added GNU style long-options (--help). Carely, some options have
+ change (but more logical).
sox-12.15
---------
--- a/Makefile.unx
+++ b/Makefile.unx
@@ -243,12 +243,15 @@
nroff -man libst.3 | col -b > libst.txt
install: sox
- -install -c -m 755 sox play rec $(BINDIR)
- -install -c -m 644 sox.1 play.1 $(MANDIR)/man1
+ if [ -f $(BINDIR)/rec ] ; then $(RM) $(BINDIR)/rec; fi
+ install -c -m 755 sox play $(BINDIR)
+ install -c -m 644 sox.1 play.1 $(MANDIR)/man1
+ ln -s $(BINDIR)/play $(BINDIR)/rec
+ ln -s $(MANDIR)/play.1 $(MANDIR)/rec.1
install-lib: libst.a
- -install -c -m 644 libst.a $(LIBDIR)
- -install -c -m 644 libst.3 $(MANDIR)/man3
+ install -c -m 644 libst.a $(LIBDIR)
+ install -c -m 644 libst.3 $(MANDIR)/man3
clean:
$(RM) *~ *.o *.raw *.sf core sox libst.a
--- a/configure
+++ b/configure
@@ -2,7 +2,7 @@
# From configure.in configure.in 0.3
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -66,6 +66,7 @@
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@@ -349,7 +350,7 @@
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -519,9 +520,11 @@
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
+ac_exeext=
+ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -647,12 +650,12 @@
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:656: checking host system type" >&5
+echo "configure:659: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -659,7 +662,7 @@
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
@@ -666,7 +669,7 @@
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -673,7 +676,7 @@
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:677: checking target system type" >&5
+echo "configure:680: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -684,7 +687,7 @@
esac ;;
esac
-target=`$ac_config_sub $target_alias`
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -691,7 +694,7 @@
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:695: checking build system type" >&5
+echo "configure:698: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -702,7 +705,7 @@
esac ;;
esac
-build=`$ac_config_sub $build_alias`
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -740,7 +743,7 @@
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:744: checking for $ac_word" >&5
+echo "configure:747: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -747,8 +750,9 @@
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -769,7 +773,7 @@
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:773: checking for $ac_word" >&5
+echo "configure:777: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -776,9 +780,10 @@
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -813,25 +818,61 @@
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:828: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:821: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:860: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 831 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 871 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -845,6 +886,12 @@
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
@@ -851,12 +898,12 @@
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:855: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:902: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:860: checking whether we are using GNU C" >&5
+echo "configure:907: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -865,7 +912,7 @@
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -876,11 +923,15 @@
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:884: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:935: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -895,22 +946,26 @@
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
- CFLAGS="-O2"
+ CFLAGS="-g"
fi
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:914: checking for $ac_word" >&5
+echo "configure:969: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -917,8 +972,9 @@
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -943,16 +999,17 @@
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:951: checking for a BSD compatible install" >&5
+echo "configure:1008: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
@@ -959,12 +1016,13 @@
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -994,12 +1052,14 @@
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking for gsm_create in -lgsm""... $ac_c" 1>&6
-echo "configure:1003: checking for gsm_create in -lgsm" >&5
+echo "configure:1063: checking for gsm_create in -lgsm" >&5
ac_lib_var=`echo gsm'_'gsm_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1007,7 +1067,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lgsm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1011 "configure"
+#line 1071 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1018,7 +1078,7 @@
gsm_create()
; return 0; }
EOF
-if { (eval echo configure:1022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1060,7 +1120,7 @@
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1064: checking how to run the C preprocessor" >&5
+echo "configure:1124: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1075,14 +1135,14 @@
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1079 "configure"
+#line 1139 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
@@ -1092,14 +1152,14 @@
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1096 "configure"
+#line 1156 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
@@ -1107,11 +1167,30 @@
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1173 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
+fi
+rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
CPP="$ac_cv_prog_CPP"
@@ -1124,18 +1203,18 @@
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1128: checking for $ac_hdr" >&5
+echo "configure:1207: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1133 "configure"
+#line 1212 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1165,12 +1244,12 @@
for ac_func in getopt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1169: checking for $ac_func" >&5
+echo "configure:1248: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1174 "configure"
+#line 1253 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1193,7 +1272,7 @@
; return 0; }
EOF
-if { (eval echo configure:1197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1221,12 +1300,12 @@
for ac_func in strerror memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1225: checking for $ac_func" >&5
+echo "configure:1304: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1230 "configure"
+#line 1309 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1249,7 +1328,7 @@
; return 0; }
EOF
-if { (eval echo configure:1253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1278,7 +1357,7 @@
if test "$alsa_dsp" = auto
then
echo $ac_n "checking whether /dev/snd/pcm00 is functional (ALSA)""... $ac_c" 1>&6
-echo "configure:1282: checking whether /dev/snd/pcm00 is functional (ALSA)" >&5
+echo "configure:1361: checking whether /dev/snd/pcm00 is functional (ALSA)" >&5
if eval "test \"`echo '$''{'ac_cv_dev_alsa_dsp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1286,7 +1365,7 @@
ac_cv_dev_alsa_dsp=no
else
cat > conftest.$ac_ext <<EOF
-#line 1290 "configure"
+#line 1369 "configure"
#include "confdefs.h"
int
@@ -1302,7 +1381,7 @@
}
EOF
-if { (eval echo configure:1306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_dev_alsa_dsp=yes
else
@@ -1333,7 +1412,7 @@
if test "$oss_dsp" = auto
then
echo $ac_n "checking whether /dev/dsp is functional (OSS)""... $ac_c" 1>&6
-echo "configure:1337: checking whether /dev/dsp is functional (OSS)" >&5
+echo "configure:1416: checking whether /dev/dsp is functional (OSS)" >&5
if eval "test \"`echo '$''{'ac_cv_dev_oss_dsp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1341,7 +1420,7 @@
ac_cv_dev_oss_dsp=no
else
cat > conftest.$ac_ext <<EOF
-#line 1345 "configure"
+#line 1424 "configure"
#include "confdefs.h"
int
@@ -1357,7 +1436,7 @@
}
EOF
-if { (eval echo configure:1361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_dev_oss_dsp=yes
else
@@ -1377,18 +1456,18 @@
then
ac_safe=`echo "sys/soundcard.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/soundcard.h""... $ac_c" 1>&6
-echo "configure:1381: checking for sys/soundcard.h" >&5
+echo "configure:1460: checking for sys/soundcard.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1386 "configure"
+#line 1465 "configure"
#include "confdefs.h"
#include <sys/soundcard.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1423,7 +1502,7 @@
if test "$sun_audio" = auto
then
echo $ac_n "checking whether /dev/audio is functional (SUN, etc)""... $ac_c" 1>&6
-echo "configure:1427: checking whether /dev/audio is functional (SUN, etc)" >&5
+echo "configure:1506: checking whether /dev/audio is functional (SUN, etc)" >&5
if eval "test \"`echo '$''{'ac_cv_dev_sun_audio'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1431,7 +1510,7 @@
ac_cv_dev_sun_audio=no
else
cat > conftest.$ac_ext <<EOF
-#line 1435 "configure"
+#line 1514 "configure"
#include "confdefs.h"
int
@@ -1447,7 +1526,7 @@
}
EOF
-if { (eval echo configure:1451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_dev_sun_audio=yes
else
@@ -1467,18 +1546,18 @@
then
ac_safe=`echo "sys/audioio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/audioio.h""... $ac_c" 1>&6
-echo "configure:1471: checking for sys/audioio.h" >&5
+echo "configure:1550: checking for sys/audioio.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1476 "configure"
+#line 1555 "configure"
#include "confdefs.h"
#include <sys/audioio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1500,18 +1579,18 @@
ac_safe=`echo "sun/audioio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sun/audioio.h""... $ac_c" 1>&6
-echo "configure:1504: checking for sun/audioio.h" >&5
+echo "configure:1583: checking for sun/audioio.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1509 "configure"
+#line 1588 "configure"
#include "confdefs.h"
#include <sun/audioio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1587,7 +1666,7 @@
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -1666,7 +1745,7 @@
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1686,9 +1765,11 @@
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -1725,6 +1806,7 @@
s%@CC@%$CC%g
s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
s%@NEED_OSS@%$NEED_OSS%g
--- a/play
+++ b/play
@@ -1,6 +1,6 @@
#!/bin/sh
-# Shell script to play sound files to unix style sound devices.
-# Should auto detect most supported systems and play the file for you.
+# Shell script to play/record sound files to/from unix style sound devices.
+# Should auto detect most supported systems.
#
# Originally developed by Chris Bagwell (cbagwell@sprynet.com)
#
@@ -9,133 +9,180 @@
#
# Change History:
#
-# June 1, 1998 - Chris Bagwell (cbagwell@sprynet.com)
-#
-# Kjetil Torgrim Homme <kjetilho@ifi.uio.no> sent in a neat patch to
-# attempt an educated guess on how to play sound on sun hardware.
-# There is probably a better way to do it in the actual software though.
-#
-# Use the parsed out volume flag to have sox change the volume. Yes, its
-# better to use the audio devices hardware mixer to adjust volume but some
-# way is better then no way. Its still parsed seperately so people may
-# optionally pass the parameter to a mixer.
-#
-# September 7, 1998 - Chris Bagwell (cbagwell@sprynet.com)
-#
-# Updated usage checking a little more so that only one filename can
-# be given.
-#
-# January 9, 1999 - Chris Bagwell (cbagwell@sprynet.com)
-#
-# Quoted $filename so that files with spaces in their names can
-# be given.
-# Arnim Rupp patch file to work with multiple sound devices via
-# command line option.
-#
+# Major updates have been supplied by Kjetil Torgrim Homme and
+# Kirk Goff.
-# Set up path to sox so that it can find it if user's path doesn't already
+# Set up path so that it can find Sox if user's path doesn't already
# include it.
PATH=$PATH:/usr/local/bin
-export PATH
+program_name=`basename $0`
+program_version="2.0"
-help()
+if [ -z "$1" ]; then
+ echo "\
+$program_name: too few arguments
+Try \`$program_name --help' for more information." 1>&2
+ exit 1
+fi
+
+version()
{
- echo "play v1.5 - front end to Sox"
- echo ""
- echo "Usage: play [ fopts ] infile [effects]"
- echo
- echo "fopts: -c channels -d device -h -r rate -t type -v volume -s/-u/-U/-A -b/-w/-l/-f/-d/-D -x"
- echo
- echo "effects: avg/band/chorus/copy/cut/deemph/echo/echos/flanger/highp/lowp/map/mask/phaser/pick/polyphase/rate/resample/reverb/reverse/split/stat/vibro"
- echo ""
- echo "See sox man page for more info on required effects options."
+ echo "$program_name (sox) $program_version"
+ exit 0
}
-if [ "$1" = "" ] ; then
- help; exit 1;
-fi
+help()
+{
+ echo "\
+Usage: $program_name [OPTION]... FILE [EFFECT]...
+Play/record sound files to/from unix style sound devices.
-while [ $# -ne 0 ] # loop over arguments
-do case $1 in
- avg|band|chorus|copy|cut|echo|echos|flanger|highp|lowp|map|mask|phaser|pick|pred|rate|resample|reverb|reverse|split|stat|vibro)
- effects="$@"
- break
- ;;
- -c)
- shift
- fopts="$fopts -c $1"
- ;;
- -d)
- shift
- device="$1"
- ;;
- -h)
- help;
- exit 1;
- ;;
- -r)
- shift
- fopts="$fopts -r $1"
- ;;
- -t)
- shift
- fopts="$fopts -t $1"
- ;;
- -v)
- shift
- volume="-v $1"
- ;;
- -)
- filename="-"
- ;;
- -*)
- fopts="$fopts $1"
- ;;
- *)
- if [ "$filename" = "" ]; then
- filename="$1"
- else
- echo "Filename already give. Ingoring extra name: $1"
- fi
- ;;
- esac
- shift
-done
+ -c, --channels=CHANNELS specifies the number of sound channels in FILE
+ -d, --device=DEVICE use DEVICE for input/output
+ -f, --format=FORMAT specifies bit format of sample
+ FORMAT is either s, u, U, A, a, or g
+ -r, --rate=RATE sample rate in hertz of FILE
+ -s, --size=SIZE interpret size of sample
+ SIZE is either b, w, l, f, d, or D
+ -t, --type=TYPE specifies file format of FILE
+ -v, --volume=VOLUME change amplitude
+ -x, --xinu reverse bit order of sample
+ (only works with 16-bit and 32-bit integer data)
+ --file next argument is FILE
+ -h, --help display this help and exit
+ --version output version information and exit
-arch=`uname -s`
+EFFECTs are one or more of the following: avg, band, chorus, copy, cut,
+deemph, echo, echos, flanger, highp, lowp, map, mask, phaser, pick, polyphase
+rate, resample, reverb, reverse, split, stat, vibro.
-if [ "$arch" = "SunOS" ]; then
+See sox man page for detailed information on supported file types, data
+formats, and effect options."
+ exit 0
+}
- if [ "$device" = "" ]; then
- device="/dev/audio"
- fi
- case `arch -k` in
- sun4|sun4c|sun4d)
- # Use below for older Sun audio hardware
- sox $volume $fopts "$filename" -t sunau -U -c 1 $device $effects
- ;;
+# loop over arguments
+while [ $# -ne 0 ]; do
+ case "$1" in
+ avg|band|chorus|copy|cut|deemph|echo|echos|flanger|highp|lowp|map|mask|phaser|pick|polyphase|rate|resample|reverb|reverse|split|stat|vibro)
+ effects="$@"
+ break
+ ;;
+ -c)
+ shift
+ fopts="$fopts -c $1"
+ ;;
+ --channels=*)
+ fopts="$fopts -c `echo $1 | sed 's/.*=//'`"
+ ;;
+ -d)
+ shift
+ device="$1"
+ ;;
+ --device=*)
+ device=`echo $1 | sed 's/.*=//'`
+ ;;
+ -f)
+ shift
+ fopts="$fopts -$1"
+ ;;
+ --format=*)
+ fopts="$fopts -`echo $1 | sed 's/.*=//'`"
+ ;;
+ -r)
+ shift
+ fopts="$fopts -r $1"
+ ;;
+ --rate=*)
+ fopts="$fopts -r `echo $1 | sed 's/.*=//'`"
+ ;;
+ -s)
+ shift
+ fopts="$fopts -$1"
+ ;;
+ --size=*)
+ fopts="$fopts -`echo $1 | sed 's/.*=//'`"
+ ;;
+ -t)
+ shift
+ fopts="$fopts -t $1"
+ ;;
+ --type=*)
+ fopts="$fopts -t `echo $1 | sed 's/.*=//'`"
+ ;;
+ -v)
+ shift
+ volume="-v $1"
+ ;;
+ --volume=*)
+ volume="-v `echo $1 | sed 's/.*=//'`"
+ ;;
+ -x|--xinu)
+ fopts="$fopts -x"
+ ;;
+ --file)
+ shift
+ if [ -z "$filename" ]; then
+ filename="$1"
+ else
+ echo "Filename already given. Ignoring extra name: $1" 1>&2
+ fi
+ ;;
+ -h)
+ help
+ ;;
+ --help)
+ help
+ ;;
+ --version)
+ version
+ ;;
+ -)
+ filename="-"
+ ;;
+ -*)
+ fopts="$fopts $1"
+ ;;
+ *)
+ if [ -z "$filename" ]; then
+ filename="$1"
+ else
+ echo "Filename already given. Ignoring extra name: $1" 1>&2
+ fi
+
+ ;;
+ esac
+ shift
+done
- *)
- # Use below for newer Sun audio hardware that supports stereo linear
- sox $volume $fopts "$filename" -t sunau -w -s $device $effects
- ;;
-
- esac
-
-else
- if [ "$arch" = "Linux" ]; then
-
- if [ "$device" = "" ]; then
- device="/dev/dsp"
+arch=`uname -s`
+if [ "$arch" = "SunOS" ]; then
+ case `arch -k` in
+ # Use below for older Sun audio hardware
+ sun4|sun4c|sun4d)
+ arch_defines="-t sunau -U -c 1"
+ ;;
+ # Use below for newer Sun audio hardware that supports stereo linear
+ *)
+ arch_defines="-t sunau -w -s"
+ ;;
+ esac
+ if [ -z "$device" ]; then
+ device="/dev/audio"
fi
+elif [ "$arch" = "Linux" ]; then
+ arch_defines="-t ossdsp"
+ if [ -z "$device" ]; then
+ device="/dev/dsp"
+ fi
+fi
-# Possible way to set volume
-# if [ "$volume" != "" ] ; then
-# mixer $volume
-# fi
-
- # Best to always use highest quality output for sound.
- sox $volume $fopts "$filename" -t ossdsp -w -s $device $effects
- fi
+# If name is "rec" then record else assume user is wanting to play
+# a sound file.
+if [ "$program_name" = "rec" ]; then
+ echo "Send break (control-c) to end recording"
+ sox $volume $arch_defines $fopts $device "$filename" $effects
+else
+ sox $volume $fopts "$filename" $arch_defines $device $effects
fi
--- a/play.1
+++ b/play.1
@@ -2,43 +2,67 @@
.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
.\" other parms are allowed: see man(7), man(1)
.SH NAME
-play \- play any sound file
+play \- play any sound file to audio device
+.P
+rec \- record audio to any sound file format
.SH SYNOPSIS
.B play
.I "[fopts] infile [effect]"
+.P
+.B rec
+.I "[fopts] outfile [effect]"
.SH "DESCRIPTION"
This manual page documents briefly the
-.BR play
+.B play and rec
command.
.PP
.B play
-is a program that allows you to play different types of sound files. It is
+and
+.B rec
+are programs that allows you to play and record different types of sound files. It is
a frontend to the more general sox package. Normally the play command
will detect the type and other parameters of the soundfile. If it can't do
-so, the parametes can be changed through options.
+so, the parameters can be changed through options.
.SH OPTIONS
A summary of common options are included below.
-For a complete description for options and supported formats, see
+For a complete description of options and thier values, see
the
.B sox(1)
man page.
.TP
-.B \-h
-Show summary of options.
+.B \-c [channels], \-\-channels=[channels]
+Define the number of channels of the file.
.TP
-.B \-r rate
-Define the samplerate of the playback.
+.B \-d [device], \-\-device=[device]
+Specify a different device to play the sound file to.
.TP
-.B \-v volume
-Change the playback Volume.
+.B \-f [format], \-\-format=[format]
+Specifies bit format of sample. One of s, u, U, A, a, or g.
.TP
-.B \-c channels
-Define the number of channels of the file.
+.B \-r [rate], \-\-rate=[rate]
+Define the samplerate of the audio data.
.TP
-.B \-d device
-Specify a different device to play the sound file to.
+.B \-s [size], \-\-size=[size]
+interpret size of sample. One of b, w, l, f, d, or D.
.TP
-Other options and a description of effects are described in the sox man page.
+.B \-t [type], \-\-type=[type]
+Specifies audio file format to use. Useful if it can not be determined
+on its own.
+.TP
+.B \-v [volume], \-\-volume=[volume]
+Change the audio volume
+.TP
+.B \-x , \-\-xinu
+Reverse the byte order of the sample (only works with 16 and 32-bit data).
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-\-version
+Show version of play/rec.
+
+.TP
+Description of effects are described in the sox man page.
.SH "SEE ALSO"
--- a/sox.1
+++ b/sox.1
@@ -457,9 +457,9 @@
Reduce the number of channels by averaging the samples,
or duplicate channels to increase the number of channels.
Valid combinations are 1 - 2, 1 - 4, 2 - 4, 4 - 2, 4 - 1,
-2 - 1. The \fI-l\fR or \fI-r\fR option averages from
-just left or right channels/duplicates to just the left
-or right channels.
+2 - 1. The \fI-l\fR or \fI-r\fR option is not really averaging but
+either duplicates or leaves just the left or right channel, depending
+on if your increasing or decreasing the number of output channels.
.TP 10
band \fB[ \fI-n \fB] \fIcenter \fB[ \fIwidth\fB ]
Apply a band-pass filter.
--- a/sox.txt
+++ b/sox.txt
@@ -434,25 +434,25 @@
samples, or duplicate channels to increase the
number of channels. Valid combinations are 1 -
2, 1 - 4, 2 - 4, 4 - 2, 4 - 1, 2 - 1. The -l or
- -r option averages from just left or right chan-
- nels/duplicates to just the left or right chan-
- nels.
+ -r option is not really averaging but either
+ duplicates or leaves just the left or right
+ channel, depending on if your increasing or
+ decreasing the number of output channels.
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
+ mental music. The -n (for noise) option uses
the alternate mode for un-pitched signals. Band
- introduces noise in the shape of the filter,
- i.e. peaking at the center frequency and set-
+ introduces noise in the shape of the filter,
+ i.e. peaking at the center frequency and set-
tling around it.
- chorus gain-in gain-out delay decay speed deptch
@@ -466,31 +466,33 @@
SoX(1) SoX(1)
+ chorus gain-in gain-out delay decay speed deptch
+
-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.
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, or the rates are "close".
cut loopnumber
Extract loop #N from a sample.
- deemph Apply a treble attenuation shelving filter to
+ deemph Apply a treble attenuation shelving filter to
samples in audio cd format. The frequency
- response of pre-emphasized recordings is recti-
- fied. The filtering is defined in the standard
+ response of pre-emphasized recordings is recti-
+ fied. The filtering is defined in the standard
document ISO 908.
echo gain-in gain-out delay decay [ delay decay ... ]
Add echoing to a sound sample. Each delay/decay
- part gives the delay in milliseconds and the
+ part gives the delay in milliseconds and the
decay (relative to gain-in) of that echo. Gain-
out is the volume of the output.
@@ -497,32 +499,30 @@
echos gain-in gain-out delay decay [ delay decay ... ]
Add a sequence of echos to a sound sample. Each
delay/decay part gives the delay in milliseconds
- and the decay (relative to gain-in) of that
+ and the decay (relative to gain-in) of that
echo. Gain-out is the volume of the output.
flanger gain-in gain-out delay decay speed -s | -t
- Add a flanger to a sound sample. Each triple
- delay/decay/speed gives the delay in millisec-
- onds and the decay (relative to gain-in) with a
+ Add a flanger to a sound sample. Each triple
+ delay/decay/speed gives the delay in millisec-
+ onds and the decay (relative to gain-in) with a
modulation speed in Hz. The modulation is
- either sinodial (-s) or triangular (-t). Gain-
+ either sinodial (-s) or triangular (-t). Gain-
out is the volume of the output.
highp center
- Apply a high-pass filter. The frequency
- response drops logarithmically with center fre-
- quency in the middle of the drop. The slope of
+ Apply a high-pass filter. The frequency
+ response drops logarithmically with center fre-
+ quency in the middle of the drop. The slope of
the filter is quite gentle.
lowp center
Apply a low-pass filter. The frequency response
- drops logarithmically with center frequency in
+ drops logarithmically with center frequency in
the middle of the drop. The slope of the filter
- is quite gentle.
-
March 5, 1999 8
@@ -532,28 +532,30 @@
SoX(1) SoX(1)
+ is quite gentle.
+
map Display a list of loops in a sample, and miscel-
laneous loop info.
- mask Add "masking noise" to signal. This effect
- deliberately adds white noise to a sound in
- order to mask quantization effects, created by
- the process of playing a sound digitally. It
- tends to mask buzzing voices, for example. It
- adds 1/2 bit of noise to the sound file at the
+ mask Add "masking noise" to signal. This effect
+ deliberately adds white noise to a sound in
+ order to mask quantization effects, created by
+ the process of playing a sound digitally. It
+ tends to mask buzzing voices, for example. It
+ adds 1/2 bit of noise to the sound file at the
output bit depth.
phaser gain-in gain-out delay decay speed -s | -t
- Add a phaser to a sound sample. Each triple
- delay/decay/speed gives the delay in millisec-
- onds and the decay (relative to gain-in) with a
+ Add a phaser to a sound sample. Each triple
+ delay/decay/speed gives the delay in millisec-
+ onds and the decay (relative to gain-in) with a
modulation speed in Hz. The modulation is
- either sinodial (-s) or triangular (-t). The
+ either sinodial (-s) or triangular (-t). The
decay should be less than 0.5 to avoid feedback.
Gain-out is the volume of the output.
- pick Select the left or right channel of a stereo
- sample, or one of four channels in a quadro-
+ pick Select the left or right channel of a stereo
+ sample, or one of four channels in a quadro-
phonic sample.
polyphase [ -w < num / ham > ]
@@ -562,30 +564,28 @@
[ -cutoff # ]
Translate input sampling rate to output sampling
- rate via polyphase interpolation, a DSP algo-
- rithm. This method is slow and uses lots of
+ rate via polyphase interpolation, a DSP algo-
+ rithm. This method is slow and uses lots of
RAM, but gives much better results then rate.
- -w < nut / ham > : select either a Nuttal (~90
- dB stopband) or Hamming (~43 dB stopband) win-
+ -w < nut / ham > : select either a Nuttal (~90
+ dB stopband) or Hamming (~43 dB stopband) win-
dow. Warning: Nuttall windows require 2x length
than Hamming windows. Default is nut.
- -width long / short / # : specify the width of
- the filter. long is 1024 samples; short is 128
- samples. Alternatively, an exact number can be
+ -width long / short / # : specify the width of
+ the filter. long is 1024 samples; short is 128
+ samples. Alternatively, an exact number can be
used. Default is long.
- -cutoff # : specify the filter cutoff frequency
- in terms of fraction of bandwidth. If upsam-
- pling, then this is the fraction of the orignal
+ -cutoff # : specify the filter cutoff frequency
+ in terms of fraction of bandwidth. If upsam-
+ pling, then this is the fraction of the orignal
signal that should go through. If downsampling,
- this is the fraction of the signal left after
- downsampling. Default is 0.95. Remember that
+ this is the fraction of the signal left after
+ downsampling. Default is 0.95. Remember that
this is a float.
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
+ rate via linear interpolation to the Least
@@ -598,60 +598,60 @@
SoX(1) SoX(1)
- different sampling rates. This is fast but
- noisy: the spectrum of the original sound will
- be shifted upwards and duplicated faintly when
- up-translating by a multiple. Lerp-ing is
- acceptable for cheap 8-bit sound hardware, but
- for CD-quality sound you should instead use
- either resample or polyphase. If you are won-
- dering which of Sox's rate changing effects to
- ues, you will want to read a detailed analysis
- of all of them at http://usa.ece.cmu.edu/Sox/
+ Common Multiple of the two sampling rates. This
+ is the default effect if the two files have dif-
+ ferent sampling rates. This is fast but noisy:
+ the spectrum of the original sound will be
+ shifted upwards and duplicated faintly when up-
+ translating by a multiple. Lerp-ing is accept-
+ able for cheap 8-bit sound hardware, but for CD-
+ quality sound you should instead use either
+ resample or polyphase. If you are wondering
+ which of Sox's rate changing effects to ues, you
+ will want to read a detailed analysis of all of
+ them at http://usa.ece.cmu.edu/Sox/
resample [ rolloff [ beta ] ]
Translate input sampling rate to output sampling
rate via simulated analog filtration. This
- method is slower than rate, but gives much bet-
+ method is slower than rate, but gives much bet-
ter results. rolloff refers to the cut-off fre-
- quency of the low pass filter and is given in
- terms of the Nyquist frequency for the lower
- sample rate. rolloff therefor should be some-
- thing between 0. and 1., in practice 0.8-0.95.
- beta trades stop band rejection against transi-
- tion width from passband to stop band. Larger
+ quency of the low pass filter and is given in
+ terms of the Nyquist frequency for the lower
+ sample rate. rolloff therefor should be some-
+ thing between 0. and 1., in practice 0.8-0.95.
+ beta trades stop band rejection against transi-
+ tion width from passband to stop band. Larger
beta means a slower transition and greater stop-
band rejection. beta should be at least greater
- than 2. The default is rollof 0.8, beta 17.5,
- which is rather conservative with respect to
- aliasing. Lower beta and higher rolloff values
- preserve more high frequency signal energy, but
+ than 2. The default is rollof 0.8, beta 17.5,
+ which is rather conservative with respect to
+ aliasing. Lower beta and higher rolloff values
+ preserve more high frequency signal energy, but
introduce measurable artifacts.
reverb gain-out delay [ delay ... ]
- Add reverbation to a sound sample. Each delay
- is given in milliseconds and its feedback is
- depending on the reverb-time in milliseconds.
- Each delay should be in the range of half to
+ Add reverbation to a sound sample. Each delay
+ is given in milliseconds and its feedback is
+ depending on the reverb-time in milliseconds.
+ Each delay should be in the range of half to
quarter of reverb-time to get a realistic rever-
bation. Gain-out is the volume of the output.
- reverse Reverse the sound sample completely. Included
+ reverse Reverse the sound sample completely. Included
for finding Satanic subliminals.
split Turn a mono sample into a stereo sample by copy-
- ing the input channel to the left and right
+ ing the input channel to the left and right
channels.
stat [ debug | -v ]
- Do a statistical check on the input file, and
- print results on the standard error file. stat
- may copy the file untouched from input to out-
- put, if you select an output file. The "Volume
- Adjustment:" field in the statistics gives you
- the argument to the -v number which will make
- the sample as loud as possible without clipping.
- There is an optional parameter -v that will
+ Do a statistical check on the input file, and
+ print results on the standard error file. stat
+ may copy the file untouched from input to out-
+ put, if you select an output file. The "Volume
+ Adjustment:" field in the statistics gives you
+ the argument to the -v number which will make
@@ -664,43 +664,45 @@
SoX(1) SoX(1)
+ the sample as loud as possible without clipping.
+ There is an optional parameter -v that will
print out the "Volume Adjustment:" field's value
- and return. This could be of use in scripts to
- auto convert the volume. There is an also an
- optional parameter debug that will place sox
- into debug mode and print out a hex dump of the
- sound file from the internal buffer that is in
- 32-bit signed PCM data. This is mainly only of
- use in tracking down endian problems that creep
+ and return. This could be of use in scripts to
+ auto convert the volume. There is an also an
+ optional parameter debug that will place sox
+ into debug mode and print out a hex dump of the
+ sound file from the internal buffer that is in
+ 32-bit signed PCM data. This is mainly only of
+ use in tracking down endian problems that creep
in to sox on cross-platform versions.
swap [ 1 2 3 4 ]
- Swap channels in multi-channel sound files. In
- files with more than 2 channels you may specify
+ Swap channels in multi-channel sound files. In
+ files with more than 2 channels you may specify
the order that the channels should be rearranged
in.
vibro speed [ depth ]
- Add the world-famous Fender Vibro-Champ sound
+ Add the world-famous Fender Vibro-Champ sound
effect to a sound sample by using a sine wave as
the volume knob. Speed gives the Hertz value of
- the wave. This must be under 30. Depth gives
- the amount the volume is cut into by the sine
- wave, ranging 0.0 to 1.0 and defaulting to 0.5.
+ the wave. This must be under 30. Depth gives
+ the amount the volume is cut into by the sine
+ wave, ranging 0.0 to 1.0 and defaulting to 0.5.
- Sox enforces certain effects. If the two files have dif-
+ Sox enforces certain effects. If the two files have dif-
ferent sampling rates, the requested effect must be one of
- copy, or rate, If the two files have different numbers of
+ copy, or rate, If the two files have different numbers of
channels, the avg effect must be requested.
BUGS
- 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
+ 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.
- Please report any bugs found in this version of sox to
+ Please report any bugs found in this version of sox to
Chris Bagwell (cbagwell@sprynet.com)
FILES
@@ -708,16 +710,14 @@
play(1), rec(1)
NOTICES
- The echoplex effect is: Copyright (C) 1989 by Jef
+ The echoplex effect is: Copyright (C) 1989 by Jef
Poskanzer.
Permission to use, copy, modify, and distribute this soft-
ware 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.
+ 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
@@ -730,14 +730,14 @@
SoX(1) SoX(1)
- The version of Sox that accompanies this manual page is
- support by Chris Bagwell (cbagwell@sprynet.com). Please
+ documentation. This software is provided "as is" without
+ express or implied warranty.
+
+ 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
+ obtain the latest version at the the web site
http://home.sprynet.com/~cbagwell/sox.html
-
-
-
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -100,12 +100,15 @@
nroff -man libst.3 | col -b > libst.txt
install: sox
- -$(INSTALL) -c -m 755 sox play rec $(BINDIR)
- -$(INSTALL) -c -m 644 sox.1 play.1 $(MANDIR)/man1
+ if [ -f $(BINDIR)/rec ] ; then $(RM) $(BINDIR)/rec; fi
+ $(INSTALL) -c -m 755 sox play $(BINDIR)
+ $(INSTALL) -c -m 644 sox.1 play.1 $(MANDIR)/man1
+ ln -s $(BINDIR)/play $(BINDIR)/rec
+ ln -s $(MANDIR)/play.1 $(MANDIR)/rec.1
install-lib: libst.a
- -$(INSTALL) -c -m 644 libst.a $(LIBDIR)
- -$(INSTALL) -c -m 644 libst.3 $(MANDIR)/man3
+ $(INSTALL) -c -m 644 libst.a $(LIBDIR)
+ $(INSTALL) -c -m 644 libst.3 $(MANDIR)/man3
clean:
$(RM) *.o
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -530,6 +530,7 @@
8 /*SSND hdr*/ + 12 /*SSND chunk*/;
int bits = 0;
int i;
+ int comment_size;
hsize += 8 + 2 + 16*ft->instr.nloops; /* MARK chunk */
hsize += 20; /* INST chunk */
@@ -549,8 +550,13 @@
/* discouraged by Apple in preference to a COMT comments */
/* chunk, which holds a timestamp and marker id */
fputs("ANNO", ft->fp);
- wlong(ft, (LONG) strlen(ft->comment)); /* ANNO chunk size, the No of chars */
+ /* Must put an even number of characters out. True 68k processors OS's
+ * seem to require this */
+ comment_size = strlen(ft->comment);
+ wlong(ft, (LONG)(((comment_size % 2) == 0) ? comment_size : comment_size + 1)); /* ANNO chunk size, the No of chars */
fputs(ft->comment, ft->fp);
+ if (comment_size % 2 == 1)
+ fputs(" ", ft->fp);
/* COMM chunk -- describes encoding (and #frames) */
fputs("COMM", ft->fp);
--- a/src/au.c
+++ b/src/au.c
@@ -40,6 +40,7 @@
#define SUN_G721 23 /* CCITT G.721 4-bits ADPCM */
#define SUN_G723_3 25 /* CCITT G.723 3-bits ADPCM */
#define SUN_G723_5 26 /* CCITT G.723 5-bits ADPCM */
+#define SUN_ALAW 27 /* a-law encoding */
/* The other formats are not supported by sox at the moment */
/* Private data */
@@ -143,6 +144,9 @@
ft->info.style = ULAW;
ft->info.size = BYTE;
break;
+ case SUN_ALAW:
+ ft->info.style = ALAW;
+ ft->info.size = BYTE;
case SUN_LIN_8:
ft->info.style = SIGN2;
ft->info.size = BYTE;
@@ -318,6 +322,8 @@
if (ft->info.style == ULAW && ft->info.size == BYTE)
encoding = SUN_ULAW;
+ else if (ft->info.style == ALAW && ft->info.size == BYTE)
+ encoding = SUN_ALAW;
else if (ft->info.style == SIGN2 && ft->info.size == BYTE)
encoding = SUN_LIN_8;
else if (ft->info.style == SIGN2 && ft->info.size == WORD)
@@ -324,7 +330,7 @@
encoding = SUN_LIN_16;
else {
report("Unsupported output style/size for Sun/NeXT header or .AU format not specified.");
- report("Only U-law, signed bytes, and signed words are supported.");
+ report("Only U-law, A-law signed bytes, and signed words are supported.");
report("Defaulting to 8khz u-law\n");
encoding = SUN_ULAW;
ft->info.style = ULAW;