Sound eXchange (SoX) is a cross-platform audio editing software. It has a command-line interface, and is written in standard C. It is free software, licensed under GPL-2.0-or-later, with libsox licensed under LGPL-2.1-or-later, and distributed by Chris Bagwell through SourceForge.

Code updates at SourceForge have stopped 2015 with version 14.4.2. The sox_ng project bundles bug fixes and new features from several sources, and is used by many distributions to provide the package.

Features

thumb|right|160px|A SoX spectrogram

Some of SoX's features are:

  • Cross-platform (Windows, Linux, Solaris, OS X, et al.)
  • Reading and writing Au, WAV, AIFF, MP3 (via an external LAME MP3 encoder), Ogg Vorbis, FLAC and other audio file formats
  • Recording and playing audio (on many systems); playing via URL (internet file or stream)
  • Editing via concatenate, trim, pad, repeat, reverse, volume, fade, splice, normalise
  • Processing via chorus, flanger, echo, phaser, compressor, delay, filter (high-pass, low-pass, shelving, etc.)
  • Adjustment of speed (pitch and tempo), pitch (without tempo), tempo (without pitch), and sample rate
  • Noise removal using frequency profiling, implemented since December 2004
  • Silent passage removal
  • Simple audio synthesis
  • Generating White noise, Pink noise, and Brown noise
  • Multi-file & multi-track mixing
  • Multi-file merging (e.g., 2 mono to 1 stereo)
  • Statistical analysis; spectrogram analysis

Examples

SoX being used to process some audio:

<pre><nowiki>

$ sox track1.wav track1-processed.flac remix - norm -3

highpass 22 gain -3 rate 48k norm -3 dither

Input File : 'track1.wav'

Channels : 2

Sample Rate : 44100

Precision : 16-bit

Duration : 00:02:54.97 = 7716324 samples = 13123 CDDA sectors

Sample Encoding: 16-bit Signed Integer PCM

Endian Type : little

Output File : 'track1-processed.flac'

Channels : 1

Sample Rate : 48000

Precision : 16-bit

Duration : 00:02:54.97 = 8398720 samples ~ 13123 CDDA sectors

Sample Encoding: 16-bit FLAC

sox: effects chain: input 44100Hz 2 channels 16 bits (multi)

sox: effects chain: remix 44100Hz 2 channels 16 bits (multi)

sox: effects chain: norm 44100Hz 1 channels 16 bits

sox: effects chain: highpass 44100Hz 1 channels 16 bits

sox: effects chain: gain 44100Hz 1 channels 16 bits (multi)

sox: effects chain: rate 44100Hz 1 channels 16 bits

sox: effects chain: norm 48000Hz 1 channels 16 bits

sox: effects chain: dither 48000Hz 1 channels 16 bits (multi)

sox: effects chain: output 48000Hz 1 channels 16 bits (multi) </nowiki></pre>

Playing some audio files:

<pre><nowiki>

$ play *.ogg

01 - Summer's Cauldron.ogg:

Encoding: Vorbis

Channels: 2 @ 16-bit Track: 01 of 15

Samplerate: 44100Hz Album: Skylarking

Album gain: -7.8dB Artist: XTC

Duration: 00:03:19.99 Title: Summer's Cauldron

In:20.8% 00:00:41.61 [00:02:38.38] Out:1.84M [ ====|==== ] Clip:0 </nowiki></pre>

Generating Brown noise:

<pre><nowiki>

$ play -n synth brown

play WARN alsa: can't encode 0-bit Unknown or not applicable

File Size: 0

Encoding: n/a

Channels: 1 @ 32-bit

Samplerate: 48000Hz

Replaygain: off

Duration: unknown

In:0.00% 00:00:17.41 [00:00:00.00] Out:836k [!=====|=====!] Hd:0.0 Clip:0 </nowiki></pre>

Vulnerabilities

SoX has had several vulnerabilities listed in the National Vulnerability Database since its last public release in 2015. These vulnerabilities include stack and heap overflows and denial-of-service attacks.

See also

  • Digital audio
  • Audio file format
  • Audio signal processing
  • Multitrack recording
  • Audio mastering
  • Sample rate conversion
  • Free audio software
  • List of Linux audio software

References

  • NVD entries for SoX