Questions tagged [sox]

SoX (Sound eXchange) is a computer program for audio manipulation

Sound eXchange, abbreviated SoX, is a free cross-platform digital audio editor, licensed under the GNU General Public License.

It can read and write many audio formats, including AU, WAV, AIFF, MP3 (via an external LAME MP3 encoder), Ogg Vorbis and FLAC. Some random features :

  • Editing via concatenate, trim, pad, repeat, reverse, volume, fade, splice, normalise
  • Recording and playing audio (on many systems); playing via URL (internet file or stream)
  • 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
  • Silent passage removal
  • Multi-file merging, multi-file and multi-track mixing.
85 questions
135
votes
2 answers

How to add a mp3 handler to sox?

I want to play music in the terminal with sox. # install sox/lame sudo apt-get install sox sudo apt-get install lame # play music play music.mp3 # play FAIL formats: no handler for file extension `mp3' # mp3 -> wav lame --decode music.mp3…
kev
  • 13,200
24
votes
1 answer

command-line utility to record from microphone

I am looking for command-line utility that monitors the microphone, and if you start to speak, writes the file. Recording period should be adjusted. Solution is: sox -t alsa default recording.wav silence 1 0.1 5% 1 1.0 5%
kirill
  • 351
17
votes
3 answers

Create a video file from an audio file and add visualizations from audio

My initial thought was to upload audio files to YouTube along with video that is inspired from the audio. The particular visualization can be in different form such as spectrum, spectogram, or other forms of visualizations that change with the…
Sun
  • 6,480
13
votes
2 answers

How do I append a bunch of .wav files while retaining (not-zero-padded) numeric ordering?

I have many (7500) .wav files (named by their numbers) which I'd like to merge into one. I think it has to be done with a bash loop because with using globbing some files would be in the wrong order (like 1111 before 2). What's the best way to do…
Neula
  • 1,033
13
votes
4 answers

Creating stereo file from two mono files with sox

I'm using sox 14.2.0 on Centos 6.0. I have two mono wav files, left.wav and right.wav. I need to combine them into one stereo.ogg file, with left.wav pan 80% to the left, and right.wav pan 80% to the right. I was unable to come up with the sox…
haimg
  • 23,153
  • 17
  • 83
  • 117
12
votes
4 answers

Loop audio file to a given length

I'm currently facing an issue where I need to take some mp3 file and make another mp3 file where the first one is playing for a given amount of time, looped if needed. Preferably I'm looking for a command line solution. Tried ffmpeg and sox, but…
Tomcatus
  • 370
  • 1
  • 3
  • 12
9
votes
1 answer

How to extract vocals from music using a command line software?

I know how to remove the vocals by using SoX. The command is sox source.wav mono.wav oops which means to mix stereo to twin-mono where each mono channel contains the difference between the left and right stereo channels. It's equivalent to sox…
whatUwant
  • 161
6
votes
1 answer

How to record 10 seconds of audio with SoX?

I want to record 10 seconds of audio from my microphone input with SoX. I haven’t found any example in the documentation or elsewhere that would show how to do it. Here’s my current command using timeout to stop the recording. Is there a better way…
shrx
  • 474
6
votes
1 answer

sox: How to specify audio input and audio output devices on OSX

In Linux, I used to use the following command, which takes audio input, applies reverb and a pitch shift effects, and then outputs the result to the specified audio device. sox -r 44100 -t alsa hw:1 -t alsa hw:0 reverb 1 50 10 50 pitch 100 On…
regulatre
  • 500
  • 2
  • 6
  • 18
5
votes
3 answers

how to record mic input and pipe the output to another program

Hi everyone Im trying to follow a tutorial on generating truly random bits How To Generate Truly Random Bits This is the command from the tutorial but it does not work rec -c 1 -d /dev/dsp -r 8000 -t wav -s w - | ./noise-filter >bits I know i can…
acrs
  • 51
5
votes
4 answers

script to run sox to combine multiple mono tracks to stereo

I have a folder full of .wav audio files. Some are stereo, most are mono splits. The mono split pairs are all named foo bar track.L.wav and foo bar track.R.wav I can use the command line tool sox to combine a mono pair into 1 stereo track like…
d0g
  • 2,380
  • 5
  • 36
  • 43
4
votes
2 answers

How to convert audio file of type G.723.1 into wav format?

I have few audio files which have .wav extension. I tried to get information about this file using soxi command but I got following error : soxi FAIL formats: can't open input file foo.wav': Unknown WAV file encoding (type a100) So I…
Shekhar
  • 751
4
votes
1 answer

Is it possible to record the output of sound in macOS from the Terminal?

I would like to record the output audio of my Mac to an audio file using the command line, where I can specify the length of time to record. So for example, I might ask the command to record to a file for 10 seconds. How do I do this? Can it be done…
Baz
  • 529
3
votes
0 answers

Remove sections of audio in SoX

What's the easiest way to remove the specified sections of a wav file using SoX? Right now I use the trim command to break up the file and then concatenate the parts. However, that seems a little tedious and backwards since trim takes a section of…
Guest
  • 31
3
votes
1 answer

How to trim and join several parts of an audio file using crossfades?

I want to keep several sections of an audio file, merged together, but without any discontinuities ("clicks") at the join points. There's a SoX command that does this (https://superuser.com/a/677351), but it does not do any crossfade, so there will…
Display Name
  • 1,133
1
2 3 4 5 6