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
8
votes
2 answers

How to convert headerless ima-adpcm raw file to wav using sox

I am trying to convert a raw file (header-less) to wav It is in ADPCM 16 rate 8000 I have tried three console commands sox -e ima-adpcm -r 8000 input.raw output.wav sox -e ima-adpcm -r 8000 -b 16 input.raw output.wav These trigger the same…
QGA
  • 3,114
  • 7
  • 39
  • 62
8
votes
2 answers

Sox + MP3: libsox-fmt-mp3 not working

My server threw this error Sox::Error (sox FAIL formats: no handler for file extension `mp3' ) This person (https://superuser.com/questions/421153/how-to-add-a-mp3-handler-to-sox) had a similar issue. The solution listed there was sudo apt-get…
Morgan
  • 1,438
  • 3
  • 17
  • 32
8
votes
3 answers

SoX doesn't work with Opus Audio files

I am recording input microphone from a web page with WebRTC and process it through SoX. Problem is, Firefox recordings are in Opus Audio format (according to VLC media informations), in an Ogg container, and SoX doesn't like it : /opt/local/bin/sox…
ryancey
  • 1,037
  • 2
  • 11
  • 27
8
votes
1 answer

Sox - Converting files Sample rate not specified

This is a follow up question from: wac-to-wav-conversion I have changed the file extension from .wac to .raw and used the following command: sox -r 44100 -e unsigned -b 8 -c 1 input.raw output.wav This converts to the .wav file, however distorts…
Phorce
  • 2,632
  • 13
  • 43
  • 76
7
votes
1 answer

how to use sox to compress mp3?

I'd like to reduce the file size of some mp3 audios with sox. I think I can reduce stereo to only 1 channel (i.e. mono), reduce the sample rate and reduce the bit-depth. I find it seems sox can do none of that. Is this true or did I have done it…
RNA
  • 146,987
  • 15
  • 52
  • 70
7
votes
1 answer

sox - how to create mp3 file with bit rate 16kbps

Currently the command used is `sox input.wav -G -t mp3 -r 16k test.mp3` But this is creating a file with bit rate 24.0 kbps. How to make the bit rate of the out put file to 16.0 kbps?
Shamis Shukoor
  • 2,515
  • 5
  • 29
  • 33
7
votes
1 answer

Mixing audio using SOX , sox FAIL formats: can't open input file `audio_recorded.wav': WAVE: RIFF header not found

I want to mix audio using SOX in linux. This is my script. I'm a total beginner on this thing. time sox --buffer 128000 --combine mix audio1.mp3 audio_recorded.wav -C 64.0 "./Mixed.mp3" time ffmpeg -loglevel warning -i ./Output.wav -c:a…
elL
  • 767
  • 2
  • 14
  • 35
7
votes
2 answers

How to merge several audio files using sox

I use this command to merge two audio files into one using sox: sox end.mp3 -p pad 6 0 | sox - -m start.mp3 output.mp3 I was wondering how can I merge 3 or 4 audio files using only one command instead of using the "output.mp3" as the input to the…
Yngwie Pompas
  • 71
  • 1
  • 1
  • 2
6
votes
1 answer

crossfading a group of audio files with sox splice

I am able to join and crossfade two audio files using SoX, like so: sox file1.wav file2.wav outfile.wav splice -q `soxi -D file1.wav`,0.5 where the soxi substitution is fetching the duration of file1 and 0.5 is the length of the cross-fade. I am…
ted.strauss
  • 4,119
  • 4
  • 34
  • 57
6
votes
3 answers

Determining Bit-Depth of a wav file

I am looking for a fast, preferably standard library mechanism to determine the bit-depth of wav file e.g. '16-bit' or '24-bit'. I am using a subprocess call to Sox to get a plethora of audio metadata but a subprocess call is very slow and the only…
user3535074
  • 1,268
  • 8
  • 26
  • 48
6
votes
1 answer

sox file.wav -r 10 file.dat

What does a sample of a audio file contain ? When I run the command "sox file.wav -r 10 file.dat", the output is something like ; Sample Rate 10 ; Channels 2 0 0.00085449219 -0.0007019043 0.1 0.01348877 …
Prakash Raman
  • 13,319
  • 27
  • 82
  • 132
6
votes
0 answers

What's the best way to eliminate audio clipping with sox?

I am trying to convert some audio files to a raw format for machine learning and I need to ensure that clipping does not occur because I do not want it to contaminate my dataset. This question has been asked before, but unfortunately the solutions…
Alex Ryan
  • 3,719
  • 5
  • 25
  • 41
6
votes
3 answers

How do I De-Ess a sound file with SoX?

I am using SoX to create slow but pitch corrected audio files. The resulting files sound pretty good, but often have a very hard "S" sound that I would like to filter out. Many desktop programs include a "De-Essing" filter that works well, but I…
jcampbell1
  • 4,159
  • 3
  • 33
  • 35
6
votes
4 answers

How to batch convert .sph files to .wav with sox

I have a directory with many folders containing hundreds of .SPH files. I need to convert all .SPH files into .wav format. I have adopted the following code: cd %~dp0 mkdir converted FOR %%A IN (%*) DO sox -t raw -s -2 -r 22050 -c 2 %%A…
Laura
  • 1,383
  • 3
  • 9
  • 6
6
votes
2 answers

What is the effect of the "quality" option in SoX mp3 compression?

I am converting audio files of several different formats to mp3 using SoX. According to the docs, you can use the -C argument to specify compression options like the bitrate and quality, the quality being after the decimal point, for example: sox…
Michael Brook
  • 380
  • 5
  • 10
1 2
3
37 38