Skip to content

Instantly share code, notes, and snippets.

@AvnerCohen
Last active May 24, 2020 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AvnerCohen/872b24a336dc7a54522e0b046235e675 to your computer and use it in GitHub Desktop.
Save AvnerCohen/872b24a336dc7a54522e0b046235e675 to your computer and use it in GitHub Desktop.
SOX Examples - Various Audio manipulations

Use to cut 5 seconds from end of the file.

sox input output reverse trim 5 reverse

Converts the samplerate to 48kHz:

sox infile.wav -r 48k outfile.wav

Split the stereo file into two mono files:

sox infile.wav outfile.l.wav remix 1
sox infile.wav outfile.r.wav remix 2

Convert wav/ogg/aiff to MP3:

sox file.aiff file.mp3

Show File stats and metadata:

sox file.mp3 -n stat

Increase volume:

sox -v 2.0 lower.mp3 higher_volume.mp3

Decrease volume:

sox -v 0.5  higher_volume.mp3 lower.mp3

Change the speed of a file (x2) by some factor:

sox too-slow.aiff faster.aiff speed 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment