ARTICLE

sox - The Command-line Audio Workstation
Contributed by Girish Venkatachalam in Applications on 2007-04-23 19:36:37

sox stands for Sound EXchange. And it is doubtless the most capable audio processing command line utility. Its power sometimes cannot be matched even by expensive DAWs with fancy graphics and high price tags.

In the traidition of UNIX simplicity sox does exactly what you want without having to resort to extra gymnastics like viewing the waveform or loading a GUI interface. Its power is as amazing as its speed.

You should read the manual page of sox(1) as well as soxexam(1) which is a marvellous intro to "audio effects". I tried some of them and was dumb founded how much one could do with the UNIX command line...

The default sox install cannot process mp3 files. So you have to first convert it into wav format or some other format sox understands.

This is no big deal as mpg321 or ffmpeg can help you.

$ ffmpeg -i song.mp3 song.wav

Now that you have the raw wav file, the fun begins .

Is it a boring lecture by your professor that puts you to sleep?

No problem. Just enliven it with a few echo effects.

 $play lecture.wav echo 0.5 0.6 60 1
Oops! Forgot to mention that "play" is a companion program to sox and all of sox's effects can be used with play. Once you are satisfied with the result, you can write out the audio file with sox.For instance, if you want to lecture to have echo, just do this.

$ sox lecture.wav echo-lecture.wav 0.5 0.6 60 1

You can do low pass filtering, band pass filtering, high pass filtering, amplify, attenuate and process the audio file in multifarious ways. All with intuitive command lines.

$ play music.wav lowpass 1500
$ play music.wav highpass 3500 lowpass 200
#This amplifies by 5 times
# Be careful, this may lead to clipping...
$ play music.wav vol 5
$ play file.wav reverb 1.0 400.0 380.0
$ play file.wav stretch 2

It also is a mixer and you can combine multiple audio tracks by simply passing them on the command line.

One useful thing to do would be to split an mp3 file or remove unnecessary parts. You can just convert it into wav format.Then use sox for the splitting and re encode it with bladeenc or toolame.I used audacity for this as it gave me fine grained control with its zoom feature. But this is not something sox cannot do of course.

You can combine sox into a UNIX pipeline for certain interesting effects. You can record voice from a microphone directly into sox and save it into a different format or add effects on the fly.

The easy scriptability of sox lends easily into cron jobs. You are limited only by your imagination as is always the case with UNIX.


 
Discussion(s)
Submitted
Written by Mike on 2007-04-24 10:36:01
Good write up

Submitted in queue @ tweako ( http://www.tweako.com )
Discuss! Reply!

mp3 conversion
Written by nat on 2007-04-25 11:30:05
You don't want to convert from mp3 to wav, then back to mp3. You lose a lot of quality that way.
Discuss! Reply!

observer
Written by Nobody on 2007-04-28 18:50:27
Quote:

You don't want to convert from mp3 to wav, then back to mp3. You lose a lot of quality that way.





I think you are missing the point
- otherwise enlighten us all how to,
say, apply reverberation to an
MP3 (OGG, FLAC, you name it) file
directly.

That is, the most straightforward way
is to work with PCM.
Discuss! Reply!

valeriy obodzinskiy
Written by Herakles on 2007-07-05 04:04:03
Your site is very convenient in navigation and has good design. Thanks!
<a href=http://valeriy-obodzinskiy.myance.org/> valeriy obodzinskiy </a>
valeriy obodzinskiy
<a href=http://valeriy-obodzinskiy.myance.org/vechnaia-vesna-mp3-download.html> vechnaia vesna mp3 download </a><a href=http://valeriy-obodzinskiy.myance.org/devushka.html> devushka </a><a href=http://valeriy-obodzinskiy.myance.org/luchshie-pesni-1-mp3-download.html> luchshie pesni 1 mp3 download </a><a href=http://valeriy-obodzinskiy.myance.org/index.html> valeriy obodzinskiy </a><a href=http://valeriy-obodzinskiy.myance.org/vechnyy-vals-mp3-download.html> vechnyy vals mp3 download </a><a href=http://valeriy-obodzinskiy.myance.org/gliazhu-v-ozera-sinie-music.html> gliazhu v ozera sinie music </a><a href=http://valeriy-obodzinskiy.myance.org/chtoto-sluchilos-music.html> chtoto sluchilos music </a><a href=http://valeriy-obodzinskiy.myance.org/mne-snitsia-more-mp3.html> mne snitsia more mp3 </a><a href=http://valeriy-obodzinskiy.myance.org/vostochnaia-pesnia-music.html> vostochnaia pesnia music </a><a href=http://valeriy-obodzinskiy.myance.org/odno-i-to-zhe-mp3-download.html> odno i to zhe mp3 download </a>
podozhdi mp3 staryy spor song eti glaza naprotiv mp3 andzhela karnaval music zasypiat listia chtoto sluchilos mp3 download
Discuss! Reply!

Help!
Written by Avijit on 2007-10-31 02:55:30
Hi, I am trying to uninstall sox 12.17.1 from CentOS version 4.0 and try to upgrade it with sox 14.0.0 but i can't. I can't remove the older version of SoX.

Do You Have any Idea????

............;-)
Discuss! Reply!