ref: c76e2756e6174b8ada17eda00afb5df38f747fd0
parent: 22b6b7d61db4e1e79ce2e4513fa3912048bc67ff
author: robs <robs>
date: Wed Feb 13 04:11:26 EST 2008
doc updates
--- a/sox.1
+++ b/sox.1
@@ -51,11 +51,14 @@
sources, synthesise audio, and, on many systems, act as a general
purpose audio player or a multi-track audio recorder.
.SP
-The entire SoX functionality is available using just the `sox' command,
+Almost all SoX functionality is available using just the `sox' command,
however, to simplify playing and recording audio, if SoX is invoked as
`play', the output file is automatically set to be the default sound
device and if invoked as `rec', the default sound device is used as an
input source.
+The
+.BR soxi (1)
+command provides a convenient way to query audio file header information.
.SP
The heart of SoX is a library called libSoX. Those interested in
extending SoX or using it in other programs should refer to the libSoX
@@ -211,6 +214,45 @@
For all files, SoX will exit with an error
if the file type cannot be determined; command-line format options may
need to be added or changed to resolve the problem.
+.SS Play, Rec, & Default Audio Devices
+Some systems provide more than one type of (SoX-compatible) audio
+driver, e.g. ALSA & OSS, or SUNAU & AO.
+Systems can also have more than one audio device (a.k.a. `sound card').
+If more than one audio driver has been
+built-in to SoX, and the default selected by SoX when using
+.B rec
+or
+.B play
+is not the one that is wanted, then the
+.B AUDIODRIVER
+environment variable can be used to override the default e.g. on many systems,
+.EX
+ set AUDIODRIVER=oss
+ play ...
+.EE
+For
+.BR rec ,
+.BR play ,
+or
+.BR sox ,
+the
+.B AUDIODEV
+environment variable can be used to override the default audio device;
+e.g.
+.EX
+ set AUDIODEV=/dev/dsp2
+ play ...
+ sox ... -t oss
+.EE
+or
+.EX
+ set AUDIODEV=hw:0
+ play ...
+ sox ... -t alsa
+.EE
+(Note that the syntax of the
+.B set
+command may vary from system to system.)
.SS Accuracy
Many file formats that compress audio discard some of the audio signal
information whilst doing so; converting to such a format then converting
@@ -248,7 +290,7 @@
occurred when the input file was created.
Hence, if what is ultimately desired is lossily compressed audio, it is
highly recommended to perform all audio processing using lossless file
-formats and then convert to the lossy format at the final stage.
+formats and then convert to the lossy format only at the final stage.
.SP
.B N.B.
Applying multiple effects with a single SoX invocation will,
@@ -421,7 +463,7 @@
audio instead of affecting it (such as \fBnoiseprof\fR or \fBstat\fR).
.SP
The sampling rate associated with a null file
-is by default 44\*d1\ kHz, but, as with a normal
+is by default 48\ kHz, but, as with a normal
file, this can be overridden if desired using command-line format
options (see below).
.TP
--- a/soxformat.7
+++ b/soxformat.7
@@ -97,9 +97,12 @@
It works for both playing and recording audio files. When playing audio
files it attempts to set up the ALSA driver to use the same format as the
input file. It is suggested to always override the output values to use
-the highest quality format your ALSA system can handle. Example:
+the highest quality format your ALSA system can handle. Examples:
.EX
+ sox infile -t alsa
sox infile -t alsa default
+ sox infile -t alsa hw:0
+ sox -t alsa hw:1 outfile
.EE
.TP
\&\fB.amr\-nb\fR
--- a/src/sox.c
+++ b/src/sox.c
@@ -556,8 +556,8 @@
static char const * set_default_device(file_t f)
{
- /* Default audio device type in order of preference: */
- if (!f->filetype) f->filetype = getenv("AUDIOTYPE");
+ /* Default audio driver type in order of preference: */
+ if (!f->filetype) f->filetype = getenv("AUDIODRIVER");
if (!f->filetype && sox_find_format("alsa", sox_false)) f->filetype = "alsa";
if (!f->filetype && sox_find_format("oss" , sox_false)) f->filetype = "oss";
if (!f->filetype && sox_find_format("sunau",sox_false)) f->filetype = "sunau";