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

sox.exe - Mixing mono vocals with stereo music

I've tried all of sox.exe's combining methods, including sequence, mix, merge, multiply, etc. I can't get a mono vocal track to mix with a stereo music track and have the mono track centered in the mix. Using any of the methods where the audio…
user1721724
  • 89
  • 1
  • 2
  • 11
4
votes
2 answers

Installing pysox on ubuntu via pip install, cannot resolve sox.h

I'm trying to install the pysox package using pip (easy_install throws exactly the same error) on Ubuntu 12.04.2 LTS. $ pip install pysox [...] building 'pysox.sox' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall…
cneuro
  • 968
  • 13
  • 17
4
votes
2 answers

Sox and pitch change of multiple audio files

I want to change pitch, using sox, of every mp3 in every music folder I have. I wrote this in bash: function pitch_mp3 { for mp3 in /home/mp3s/*/*.mp3 do cd "$(dirname "$mp3")" output=$(basename "$mp3" .mp3)PITCHED.mp3 sox -S "$mp3" -C 192…
cikatomo
  • 1,620
  • 2
  • 23
  • 32
4
votes
2 answers

How to extend audio to to a specified length

I've got a bunch of wav files I'd like to pad with silence to make them exactly the same length. Ideally I want to do this from the command-line. I've tried using sox's pad command, but that only adds a fixed length of silence. Is there any way I…
xorsyst
  • 7,897
  • 5
  • 39
  • 58
4
votes
1 answer

Piping SoX in Python - subprocess alternative?

I use SoX in an application. The application uses it to apply various operations on audiofiles, such as trimming. This works fine: from subprocess import Popen, PIPE kwargs = {'stdin': PIPE, 'stdout': PIPE, 'stderr': PIPE} pipe =…
Cochise Ruhulessin
  • 1,001
  • 1
  • 11
  • 15
3
votes
1 answer

SoX running slow using a ProcessBuilder

I am running SoX using using a ProcessBuilder in java that trims WAV files into 30 second long WAV files. SoX is running because I can get the first 30 seconds of the file successfully trimmed and saved as a new file but it stops there however, it's…
sushixuni
  • 31
  • 2
3
votes
4 answers

Converting from 16-bit WAV to GSM using SOX

I'm currently working on some telephony integration with Asterisk and a PHP web interface. I want to give the user an option to upload their own custom greeting in a wav file, and then once it's on the server convert the wav to a gsm file at…
tdk2fe
  • 392
  • 1
  • 3
  • 13
3
votes
2 answers

How to get the length of the sum of audio files using sox?

I have a script such as following DIR=$1 ls $1 |sort -R |tail -$5 |while read file; do soxi -d $1$file done and it gives me an output like 00:40:35.18 00:43:41.23 01:04:19.64 00:59:41.92 00:51:16.32 As you can see, the program picks a random…
Jirr Sawaf
  • 133
  • 9
3
votes
1 answer

SoX: Premature EOF on .wav input file

I've got a bunch of WAV files and a script that copies them to another directory, but processes some of the files with SoX. The outputted files should all have 1 channel and have a sample rate of 44.1khz or less. Most of my files either have more…
Protofall
  • 612
  • 1
  • 6
  • 15
3
votes
0 answers

Convert ASF file with codec Racal recorder to wav

I want to convert the asf file which is having codec "A4;ACELP;;Racal Recorders". Codec is detected using MediaInfo library. The file is not playable using any common audio/video players like VLC. Converting to wav using FFmpeg fails with error…
Arshed
  • 321
  • 2
  • 11
3
votes
2 answers

Change audio file pitch without changing tempo using libsox

I developed a simple app that changes the pitch of an audio file with libsox (using this example). Here is my code. It works with 2 input arguments - input file path & output file path: #include #include #include…
DucTM31
  • 89
  • 6
3
votes
1 answer

Reproduce sox spectrogram in scipy

For example I have a wav file with speech. I can create nice spectrogram visualization with sox: wget https://google.github.io/tacotron/publications/tacotron2/demos/romance_gt.wav sox romance_gt.wav -n spectrogram -o spectrogram.png How can I…
mrgloom
  • 20,061
  • 36
  • 171
  • 301
3
votes
2 answers

How to install torch audio on Windows 10 conda?

In Anaconda Python 3.6.7 with PyTorch installed, on Windows 10, I do this sequence: conda install -c conda-forge librosa conda install -c groakat sox then in a fresh download from https://github.com/pytorch/audio I do python setup.py install and…
Lars Ericson
  • 1,952
  • 4
  • 32
  • 45
3
votes
1 answer

sox fails to split files

According to the manpage (where it had been listed as an example) the following command should split input file to multiple audio files at points with 2 seconds of silence. Instead of that it creates only one file which is reported to be about 0.2…
qdiesel
  • 401
  • 3
  • 9
3
votes
1 answer

Proper way to chain several effects with libSox and read the output data

I am trying programmatically apply few effects with libSox and I currently cannot understand if I am doing it right. For example, I need to apply tempo and gain effects and read the resulting audio in a buffer for a further processing. The…
Egor Lakomkin
  • 1,374
  • 14
  • 26