The sample limits option allows for selecting the range of data to be taken from the input files. The data is conceptually organized into frames, with samples from individual channels making up a frame. Frame numbers start at zero. Frames with negative numbers may be specified - the samples in these frames have zero values. Similarly, frame numbers beyond the end-of-file may be specified - these are assumed to have zero-valued values.
For more than one input file, channels assignments are considered to cross between input files. Consider two input files, with the first having 3 channels, and the second having 2 channels. For the combined input, these channels would be labelled A to E, with channels A, B and C from the first input file and channels D and E from the second file. The channel selection option allows a linear combination of the input channels to appear in each output channel. The data from the input files is padded out with zeros to become equal length before combining.
The default data format for the output file is chosen according to a data format promotion rule based on the data types of the input files. For single input files, the output data format will be the same as the input data format as long as that data format is compatible with the output file type.
"mu-law8" - 8-bit mu-law data "A-law8" - 8-bit A-law data "unsigned8" - offset-binary 8-bit integer data "integer8" - two's-complement 8-bit integer data "integer16" - two's-complement 16-bit integer data "float32" - 32-bit IEEE floating-point data "text" - text dataThe data formats available depend on the output file type. AFsp (Sun) audio files:
mu-law, A-law, 8-bit integer, 16-bit integer, floatRIFF WAVE files:
mu-law, A-law, offset-binary 8-bit integer, 16-bit integerAIFF-C audio files:
mu-law, A-law, 8-bit integer, 16-bit integerHeaderless files:
all data formats
"AFsp", "Sun" or "sun" - AFsp (Sun) audio file "WAVE" or "wave" - RIFF WAVE file "AIFF-C" - AIFF-C audio file "raw" or "raw_native" - Headerless file (native byte order) "raw_swap" - Headerless file (byte swapped) "raw_big-endian" - Headerless file (big-endian byte order) "raw_little-endian" - Headerless file (little-endian byte order)
...
The gain factor string takes the form
[+/-] [gain *] chan +/- [gain *] chan ...)where chan is A through E. Consider a case with a two channel input file. The output file is to have 3 channels. Output channel A is input channel A. Output channel B is the average of input channels A and B. Output channel C is input channel B. The following output channel specifications accomplish this mapping.
--chanA=A --chanB="0.5*A + 0.5*B" --chanC=BNote that * is a special character to Unix shells and should appear only within quotes to prevent the shell from interpreting it.
This program allows direct specification of the gains for 10 output channels and 20 input channels. The program can handle larger numbers of channels for the case that the input channels are in a one-to-one correspondence with the output channels. A gain factor applying to all channels can be specified with the -g or --gain option.
By default for AFsp output files, the audio file header contains a standard information string.
Standard Header Information: date:1994/01/25 19:19:39 UTC date user:kabal@aldebaran user program:CopyAudio program nameThis information can be changed with the header information string which is specified as one of the command line options. Structured information records should adhere to the above format with a named field terminated by a colon, followed by numeric data or text. Comments can follow as unstructured information. For the purpose of this program, records are terminated by newline characters. However in the header itself, the newline characters are replaced by nulls. To place a newline character into the header, escape the newline character by preceding it with a '\' character. If the first character of the user supplied header information string is a newline character, the header information string is appended to the standard header information. If not, the user supplied header information string replaces the standard header information.
CopyAudio abc.au new.au
CopyAudio --chanA=A-B abc1.au abc2.au diff.au
CopyAudio --gain=0.5 abc.au scaled.auThe same result can be obtained by specifying the gain for the (single) output channel.
CopyAudio --chanA="0.5*A" abc.au scaled.au
CopyAudio -P integer -N -S swap abc.au swap.au
CopyAudio -l 1000:1999 abc.au out.au
CopyAudio abc1.au abc2.au stereo.au
"Format, Start, Sfreq, Swapb, Nchan, ScaleF"
"undefined" - Headerless files will be rejected "mu-law8" or "MU-LAW8" - 8-bit mu-law data "A-law8" or "A-LAW8" - 8-bit A-law data "unsigned8" or "UNSIGNED8" - offset-binary 8-bit integer data "integer8" or "INTEGER8" - two's-complement 8-bit integer data "integer16" or "INTEGER16" - two's-complement 16-bit integer data "float32" or "FLOAT32" - 32-bit floating-point data "text" or "TEXT" - text data
"native" - no byte swapping "little-endian" - file data is in little-endian byte order "big-endian" - file data is in big-endian byte order "swap" - swap the data bytes as the data is read
"undefined, 0, 8000., native, 1, 1.0"