Sox: Difference between revisions

From EMC23 - Satellite Of Love
Jump to navigation Jump to search
(Created page with "= SoX − Sound eXchange, the Swiss Army knife of audio manipulation = == SYNOPSIS == sox [global-options] [ format-options] infile1 [[format-options] infile2] . .. [format-op...")
(No difference)

Revision as of 09:51, 2 September 2021

SoX − Sound eXchange, the Swiss Army knife of audio manipulation[edit]

SYNOPSIS[edit]

sox [global-options] [ format-options] infile1 [[format-options] infile2] . .. [format-options] outfile [effect [effect-options]] ... play [global-options] [ format-options] infile1 [[format-options] infile2] . .. [format-options] [effect [effect-options]] ... rec [global-options] [ format-options] outfile [effect [effect-options]] ...

DESCRIPTION[edit]

Introduction[edit]

SoX reads and writes audio files in most popular formats and can optionally apply effects to them. It can combine multiple input sources, synthesise audio, and, on many s ystems, act as a general purpose audio player or a multi-track audio recorder. It a lso has limited ability to split the input into multiple output files. All SoX functionality is available using just the sox command. To s implify playing and recording audio, if SoX is invoked a s play, t he output file is automatically set to be the default sound device, and if invoked a s rec, t he default sound device is used as an input source. Additionally, t he soxi(1) command provides a con- venient way to just query audio file header information. The heart of SoX is a library called libSoX. Those interested in extending SoX or using it in other pro- grams should refer to the libSoX manual page: libsox(3). SoX is a command-line audio processing tool, particularly suited to making quick, simple edits and to batch processing. If you need an interactive, g raphical audio editor, u se audacity(1).

File Format Types[edit]

SoX can work with ‘self-describing’ and ‘raw’ audio files. ‘self-describing’ formats (e.g. WAV , FLAC, MP3) have a header that completely describes the signal and encoding attributes of the audio data that fol- lows. ‘raw’ or ‘headerless’ formats do not contain this information, so the audio characteristics of these must be described on the SoX command line or inferred from those of the input file. The following four characteristics are used to describe the format of audio data such that it can be pro- cessed with SoX:

sample rate[edit]

The sample rate in samples per second (‘Hertz’ or ‘Hz’). Digital telephony t raditionally uses a sample rate of 8000 Hz (8 kHz), though these days, 16 and even 3 2 k Hz are becoming more com- mon. Audio Compact Discs use 44100 Hz (44.1 k Hz). Digital Audio Tape and many c omputer systems use 48 kHz. Professional audio systems often use 96 kHz.

sample size[edit]

The number of bits used to store each sample. To day, 1 6-bit is commonly used. 8-bit was popular in the early days of computer audio. 24-bit is used in the professional audio arena. Other sizes are also used.

data encoding[edit]

The way in which each audio sample is represented (or ‘encoded’). Some encodings have variants with different byte-orderings or bit-orderings. Some compress the audio data so that the stored audio data takes up less space (i.e. disk space or transmission bandwidth) than the other format parameters and the number of samples would imply. C ommonly-used encoding types include floating-point, μ-law, ADPCM, signed-integer PCM, MP3, and FLAC.

channels[edit]

The number of audio channels contained in the file. One (‘mono’) and two ( ‘stereo’) are widely used. ‘Surround sound’ audio typically contains six or more channels. The term ‘bit-rate’ is a measure of the amount of storage occupied by an encoded audio signal over a u nit of time. It can depend on all of the above and is typically denoted as a number of kilo-bits per second (kbps). An A-law t elephony s ignal has a bit-rate of 64 kbps. MP3-encoded stereo music typically has a bit- rate of 128−196 kbps. FLAC-encoded stereo music typically has a bit-rate of 550−760 kbps