Questions tagged [sox]

SoX (Sound eXchange) is a computer program for audio manipulation. Questions about interactive use of the command line tool should be asked on Super User.

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.
563 questions
16
votes
3 answers

Sox: concatenate multiple audio files without a gap in between

I am concatenating multiple (max 25) audio files using SoX with sox first.mp3 second.mp3 third.mp3 result.mp3 which does what it is supposed to; concatenates given files into one file. But unfortunately there is a small time-gap between those files…
trainoasis
  • 6,419
  • 12
  • 51
  • 82
13
votes
1 answer

Can I use SoX to generate audio?

For a project I am working on, I need to use the SoX tool for audio generation. If there is a way to use SoX to generate certain notes/tones for a certain duration, please let me know! I have done quite some research on this to no avail. Moreover,…
user2526619
  • 145
  • 1
  • 1
  • 5
12
votes
3 answers

Get a spectrum of frequencies from WAV/RIFF using Linux command line

How to generate a file that contains the spectrum of frequencies of a WAV/RIFF sound file? I would like to use the Linux command line. I know the cool SoX function to generate PNG spectrograms: sox sound.wav -n spectrogram But I do not need a…
zsedc
  • 141
  • 1
  • 1
  • 7
12
votes
4 answers

Detecting and printing timestamps of periods of silence using SoX

I am trying to output the begin-timestamps of periods of silence (since there is background noise, by silence I mean a threshold) in a given audio file. Eventually, I want to split the audio file into smaller audio files, given these timestamps. It…
progfan
  • 2,454
  • 3
  • 22
  • 28
11
votes
4 answers

Merge 2 audio files in sox

I am trying to merge 2 wave files into one file. The 2 files should start playing at the beginning of the new file. Independently of sound length. Running the following command does not give me this result. sox -M new_input.wav myrecording.wav…
Ellen S
  • 1,047
  • 1
  • 13
  • 18
11
votes
5 answers

Sox : merge two audio files with a pad

I'm using the sox tool and I would like to merge two audio files, let's say long.ogg and short.ogg to output a file output.ogg. This is very easy using $ sox -m long.ogg short.ogg output.ogg. Thing is, I would like the short.ogg to be played after n…
zopieux
  • 2,854
  • 2
  • 25
  • 32
11
votes
3 answers

Explanation of audio stat using sox

I have a bunch of audio files and need to split each files based on silence and using SOX. However, I realize that some files have very noisy background and some don't thus I can't use a single set of parameter to iterate over all files doing the…
Nguyễn Tài Long
  • 628
  • 2
  • 7
  • 15
11
votes
4 answers

Stripping silence with sox

I have around 20,000 .wav files (all voice lines) that I need to strip the silence from the start AND end of. The "silence" isn't pure silence, so I'll need to set a threshold. I'd also like to leave a little "silence" before the actual sound/voice…
Roger Gilbrat
  • 3,755
  • 5
  • 34
  • 58
11
votes
2 answers

sox for converting flac file to 320 bit mp3

I have installed sox with support for both mp3 and flac. The below command also successfully converts flac to mp3 sox /song_files/Daughter_of_Evil.flac /song_files/Daughter_of_Evil.mp3 My problem is that the "Daughter_of_Evil.mp3" is not 320 bit…
user1058797
  • 867
  • 3
  • 10
  • 19
10
votes
2 answers

SOX and fade in and fade out

I'm trying to create a fade in and fade out for several wave files that I won't know the total time duration in seconds of. I read the manual but the example I see all looks like I need to know the full length of the file. Can someone post an…
Rick T
  • 3,349
  • 10
  • 54
  • 119
9
votes
2 answers

How do I get started training a custom voice model with Mozilla TTS on Ubuntu 20.04?

I'd like to create a custom voice in Mozilla TTS using audio samples I have recorded but am not sure how to get started. The Mozilla TTS project has documentation and tutorials, but I'm having trouble putting the pieces together -- it seems like…
GuyPaddock
  • 2,233
  • 2
  • 23
  • 27
9
votes
1 answer

Using sox for voice detection and streaming

Currently, I use sox like this: sox -d -e u-law --endian little -b 8 -c 1 -r 8000 -t ul - silence 1 0.3 1% 1 0.3 1% For reference, this is recording audio from the default microphone and outputting little endian, ulaw formatted audio at 8 bits and…
Jim Cortez
  • 471
  • 5
  • 19
9
votes
2 answers

Using SoX to change the volume level of a range of time in an audio file

I’d like to change the volume level of a particular time range/slice in an audio file using SoX. Right now, I’m having to: Trim the original file three times to get: the part before the audio effect change, the part during (where I’m changing the…
Edward Ocampo-Gooding
  • 2,782
  • 1
  • 23
  • 29
8
votes
1 answer

Remove start of new track from end of audio file

I've a couple of recordings where at the end of the track there's silence and the start of a new track (fraction). I tried to remove the start of the new track from the end of the file. My command (*nux) sox file_in.mp3 -C 320 file_out.mp3 silence…
John Doe
  • 9,843
  • 13
  • 42
  • 73
8
votes
2 answers

Split mp3 file to TIME sec each using SoX

I need to split mp3 file into slices TIME sec each. I've tried mp3splt, but it doesn't work for me if output is less than 1 minute. Is it possible do do with: sox file_in.mp3 file_out.mp3 trim START LENGTH When I don't know mp3 file LENGTH
Łukasz D. Tulikowski
  • 1,440
  • 1
  • 17
  • 36
1
2
3
37 38