Questions tagged [sox]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
4k views

How can I automatically cut all silence (0dB) from mp3 without reencoding?

As I read silenceremove will reencode file. Usually I do it manually creating file like: file 'file.mp3' inpoint 0 outpoint 01:55:00.0 file 'file.mp3' inpoint 02:03:50.0 and executing this command:...
1 vote
1 answer
4k views

issue about using sox to convert wav file with parameters changing

I want to convert a wav file(11400HZ samples rate and 2 channels) to another wav file, just changing the samples rates and channel. The command I use is : sox 1.wav -r 8000 -c 1 2.wav 1.wav can play ...
2 votes
2 answers
63 views

create sine wave with sox without a gap

I am using sox for creating synth with 100ms, this is my command: /usr/bin/sox -V -r 44100 -n -b 64 -c 1 file.wav synth 0.1 sine 200 vol -2.0dB Now when I create 3 sine wave files and combine all ...
130 votes
2 answers
121k views

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 `...
1 vote
1 answer
894 views

SoX on Windows 11 - No default audio device configured

I've installed SoX (https://sox.sourceforge.net/) in order to be able to process microphone input via node. I'm trying the most basic settings, for example, recording from the default audio device ...
1 vote
2 answers
3k views

Trouble Installing SoX

I am running Mac OSX 10.8.4 and am unable to install SoX. I have almost 0 knowledge of UNIX or terminal but require SoX for an audio job. I have downloaded Sox-14.4.1 from the site. I attempt to ...
3 votes
1 answer
6k views

need to clean up audio noise using sox

What I am doing right now is recording audio from my mic using arecord and piping the raw output to VLC like so: arecord -r 8000 - | vlc -vvv - It works great, except the audio that is coming out ...
0 votes
0 answers
43 views

Concatenating multitrack .wav files using ffmpeg

I have 32bit .wav files with around 6 channels, segmented into chunks of 2.15GB. I want to merge the files sequentially, retaining the individual channels. I would assume something like: ffmpeg -f ...
0 votes
0 answers
35 views

How to create amr file from raw amr frames?

Is there a way to create AMR file from raw AMR frames with ready to use tools such as ffmpeg or sox? Let’s say I have frames in files like so 1.bin 2.bin 3.bin. Can I create AMR file from them, ...
0 votes
1 answer
386 views

MP3 Audio file changes -- want to preserve ID3 tags and minimize quality degredation: is FLAC the best intermediate format?

I have MP3 files on which I need to perform some audio operations, then get them back to MP3. I know every operation degrades them a little bit, so my goal is just to minimize that. I need to use both ...
15 votes
3 answers
12k views

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 ...
0 votes
1 answer
66 views

Popping noise when piping audio into a vitual mic debian

I have a pipe module with the command pactl load-module module-pipe-source source_name=VirtualMic file=/tmp/virtualmic format=wav rate=44100 channels=2 I want to use SoX to play a sound file into it. ...
0 votes
0 answers
116 views

How to solve an audio stream encoding workflow thru pipes only

I have the following workflow which is typically executed on a set of provided audio files (can be MP3 files, as assumed in this example, but also different formats): file000.mp3 file001.mp3 ... What ...
0 votes
1 answer
631 views

How to remove metadata or prevent adding comment "Processed by SoX" using sox?

If you convert using sox, it adds a comment to the metadata: $ soxi audio.wav Input File : 'audio.wav' Channels : 1 Sample Rate : 48000 Precision : 24-bit Duration : 00:00:04....
5 votes
4 answers
5k views

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 ...
0 votes
1 answer
150 views

Merging two WAV files together with different durations so that the end times match

I have several pairs of wav files (obtained by recovering the audio from VoIP packet captures). I'd like to merge the two files down to a single-channel WAV file, which is easy with ffmpeg or sox. ...
1 vote
0 answers
494 views

Delay microphone input for several seconds

Using sox, I am able to record 10 seconds of mono-channel audio input: rec -c 1 "/data/wav/${EPOCHSECONDS}.wav" trim 0 10 This works perfectly fine. However, I want the recording to contain ...
0 votes
2 answers
1k views

How to get a random filename from a directory and using it within a command?

play ~/Music/audio0.flac repeat - A command for playing a single specific audio file on repeat. play ~/Music/${random_audio_file} repeat - A pseudo command for playing a single random audio file from ...
10 votes
3 answers
19k views

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 ...
12 votes
2 answers
20k views

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 (...
2 votes
1 answer
990 views

Using SoX in Python to Increase mp3 Bitrate

I am trying to increase the bitrate on an mp3 in an audio archiving program written in Python, that uses SoX. Here's a portion of the code: #fullHour is a boolean DeltaSeconds = chunk['...
0 votes
1 answer
381 views

correctly batch run chain of SoX commands step by step - issues

For all .wav files in sox-14-4-2 folder I need to remove silence at start, copy the result into an existing subfolder Output, then reverse the file, remove silence again and finally reverse again. The ...
2 votes
1 answer
428 views

Auto Batch Process - Trim, change bit rate and then normalize wav files via sox on Windows

I would like to batch process wav files in a folder: Firstly trimming the files to 5secs and placing the trimmed files in a folder called "Trim5s", then Changing the bit rate on the trimmed ...
0 votes
1 answer
1k views

How to change sample rate for all files in a directory

How do I change the sample rate for every file in the folder? I have the following code and it just erases the files -- the file size becomes 0. for i in wav/*.wav; do sox -r 8000 -e unsigned -b ...
2 votes
1 answer
110 views

Old school boom box input equivalent using SoX

I used to have a cassette tape/radio unit (boom box format) device. I used to use this to record mix tapes from my dual turntable and mixer setup. The resulting tapes were - for me - ideal for playing ...
0 votes
2 answers
426 views

Sox: Read wav and get pulse as 1 and silence as 0 and the duration of it in microseconds

The title of this question is already very clear I quess. I want to read a wav file and get pulses as 1 and silence as 0 and the duration of it in microseconds. The reason is this, I have recorded a ...
0 votes
0 answers
418 views

Duration of recorded file is longer than recording time using SoX?

I'm using SoX on Centos 7 to record the audio output from GQRX, a SDR application. I've selected Monitor of Built-in Audio Analog Stereo from the Recording Tab of the Pulseaudio Volume Control. I'm ...
5 votes
1 answer
10k views

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 ...
2 votes
1 answer
1k views

How to use SoX or ffmpeg to extract the envelope of a sound file

I need to extract the envelope from a Wav sound file. Is there a way to achieve that from the command-line using SoX or ffmpeg?
0 votes
1 answer
3k views

sox batch convert from .raw to .wav

I'm trying to convert 728 .raw files to 16khz .wav files but I'm receiving the following error sox FAIL formats: can't open input file `outputdir/rawfile/b95981d1-3aa6-4d10-b755-990915951efc': No ...
3 votes
2 answers
4k views

sox and ffmpeg combine mp3 fails `Input files must have the same sample-rate`

I am trying to combine mp3 files via sox using: sox in.mp3 in2.mp3 out.mp3 and I get: sox FAIL sox: Input files must have the same sample-rate tried the -m option, but I guess this is default. I ...
1 vote
1 answer
1k views

Ensure audio and video track are EXACTLY the same length

I generate 200 video files based on audio files generated using sox, combined with image files. Most clips are shorter than one second, none is longer than 6. I then concatenate these files and there ...
3 votes
1 answer
462 views

Using a negative stoptime for the fade argument in the SoX audio editor

This SO answer suggest that one can use a negative stoptime with fade to specify the time from the end of the file. Negative time specification works for me with trim, but not with fade. This is what ...
1 vote
2 answers
637 views

equivalent of sox for video

I often use sox for editing audio. Is there an equivalent command line tool for editing video on Linux?
0 votes
0 answers
123 views

MP3 File can't be properly converted by any program, always gets cut to <1 second in length

I can't for the life of me figure this out, there's an mp3 file I'm trying to convert to wav with 1 channel on a linux server. I always use sox however sox happily converts it exactly how I want, ...
1 vote
1 answer
2k views

Downsample FLAC file if greater than a certain sample rate?

I want to convert a whole bunch of FLAC files to ALAC using a tool like ffmpeg or sox. This by itself is easy enough with a single command line. However, I want to save disk space by downsampling only ...
1 vote
0 answers
4k views

How can I increase volume for HD mp4 files with ffmpeg?

I am converting videos using FFmpeg on Linux. Videos are 1080p at first and I convert 1080p to h264 720p and 360p. Also if videos are 360p I`m converting them to h264 360p. The problem is when ...
0 votes
0 answers
75 views

Reading inputs from Mac aggregate device separately

I understand how to create an aggregate device and have seen tutorials on how to record each input to a separate track on garage band. What I am curious about is if there is any library or utility ...
2 votes
1 answer
4k views

Error when trying to convert 2-channels sound file to mono using sox or ffmpeg

When I tried: sox file.wav -c 1 file.wav I got: sox WARN wav: Premature EOF on .wav input file When I tried: ffmpeg -i file.wav -ac 1 file.wav I got: [pcm_s16le @ 0x2997880] Invalid PCM packet, ...
1 vote
3 answers
1k views

piping cdparanoia through play, aplay, /dev/sound, etc

Currently I am trying to use cdparanoia to play from an audio cd directly without making any temporary files. I can play the first track of a cd realtime by doing cdparanoia -e 1 /dev/shm/tmp.wav 2&...
3 votes
1 answer
2k views

How do I convert a batch of audio files on Windows?

I have a folder structure like this: -dir1 -subdir1 -subdir2 -file1.wav -file2.wav -dir2 -etc... Inside the folders are thousands of audio files that need to be converted....
3 votes
1 answer
1k views

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), ...
1 vote
1 answer
2k views

How do I add libmp3lame to sox?

When I want to use sox with an mp3 I get: C:\>C:\Progs\sox\sox.exe C:\Progs\tree.mp3 -C 60.2 C:\Progs\owl.mp3 tempo 1.0 C:\Progs\sox\sox.exe FAIL util: Unable to load LAME encoder library (...
2 votes
0 answers
875 views

How to record 30 seconds of audio from the iOS simulator with sox (or equivalent)?

I want to record 30 seconds of audio from the iOS simulator on OSX. I have found an example to record audio using a microphone. How to record 10 seconds of audio with SoX? However I need to capture ...
3 votes
2 answers
2k views

Nested ssh command forwarding

In general I could realtime listen audio on the remote computer as: ssh me@gate rec -t mp3 - | play - e.g. on the computer named gate I could execute the command rec (or sox) and the audio-stream is ...
4 votes
1 answer
3k views

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 ...
0 votes
1 answer
1k views

Using sox to generate a square wave signal

I have a script (http://paste.ubuntu.com/24497460/) which uses sox to generate a wave form from a series of "pulses" and "spaces" generated by lirc from a remote control. The script creates a 19kHz ...
3 votes
1 answer
2k views

How to specify Vorbis encoding options using `sox`?

I want to record audio encoded using Vorbis quality level 6, but how to pass the encode options to rec?
0 votes
2 answers
1k views

SoX Error While Merging Multiple Audio files

I am trying to merge a folder full of wav files with the command sox *.wav combined.wav and am getting this error: sox formats: no handler for detected file type `inode/x-empty; charset=binary' I ...
1 vote
1 answer
1k views

Sox not recognised as a command in W7

I just moved from xp-32bit to W7 64bit and re-installed sox which I use to resample and create spectrogams. The batch-file cd %~dp0 mkdir converted FOR %%A IN (%*) DO sox %%A -n spectrogram -o "...