Questions tagged [sox]
SoX (Sound eXchange) is a computer program for audio manipulation
87
questions
131
votes
2
answers
122k
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 `...
24
votes
1
answer
39k
views
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 ...
15
votes
3
answers
13k
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 ...
13
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 (...
12
votes
4
answers
21k
views
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 ...
10
votes
3
answers
20k
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 ...
9
votes
1
answer
5k
views
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 ...
6
votes
1
answer
18k
views
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 ...
5
votes
4
answers
6k
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 ...
5
votes
3
answers
8k
views
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 -...
5
votes
1
answer
11k
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 ...
4
votes
2
answers
6k
views
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 <foo.wav> command but I got following error :
soxi FAIL formats: can't open input file ...
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 ...
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 ...
3
votes
1
answer
4k
views
FFmpeg audio phase reversal
I'm writing a script which performs a series of operations on several .wav files. One of the operations is phase reversal (from what I gather, a 180 degrees phase shift).
Is this possible with FFmpeg ...
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 ...
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?
3
votes
1
answer
2k
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), ...
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
5k
views
Stream live audio with noise filter in Linux
I need to strip the noise from an audio source, but it needs to happen live.
The resulting voice doesn't need to sound perfect, it just can't contain too much noise.
I've read up about sox, but it ...
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 ...
3
votes
1
answer
478
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 ...
3
votes
0
answers
238
views
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 ...
2
votes
1
answer
3k
views
Make SoX not show output
I'm recording with SoX, and I want to make it not show output at all. When recording, it shows this output:
Input File : 'default' (waveaudio)
Channels : 2
Sample Rate : 48000
Precision ...
2
votes
1
answer
1k
views
Maximum number of files that can be merged in SoX?
For anyone who has experience with the sox audio tool, what is the maximum amount (in MB) of files you have tried to merge?
So far I have merged up to 925MB worth of wav files and have not had ...
2
votes
2
answers
3k
views
How to run a play list with sox?
Is it possible to play a list of music files with sox?
It is possible to play a file by:
play song.mp3
I know I can create a batch file which includes all the files to run such as:
play song01.mp3
...
2
votes
2
answers
97
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 ...
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?
2
votes
1
answer
111
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 ...
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, ...
2
votes
1
answer
2k
views
Plotting the volume of an audio file
Most applications that play sound display its volume graphically. I need that information (the sound volume as it changes over time) written to a text file so I can plot it myself and use it for ...
2
votes
1
answer
1k
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['...
2
votes
1
answer
443
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 ...
2
votes
1
answer
2k
views
Recording mp3 on Windows 7 using SoX [duplicate]
I'd like to have a SoX one-liner that would record 1 hour of audio to mp3. I'm on Windows 7. Is this possible?
2
votes
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 ...
2
votes
1
answer
645
views
Specify audio channel to write to monaural file using SoX
I am interested in using SoX as part of a transcoding workflow I'm building. I need to be able to downmix stereo audio streams to mono. More specifically, I need to be able to specify which channel to ...
2
votes
0
answers
894
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 ...
2
votes
1
answer
1k
views
Merging files with sox sequentially
I have seen posts where people merge multiple sound files into one outfile like: soxmix in1.wav in2.wav in3.wav out.wav. However they are all on top of each other. Is there a way to merge so that ...
2
votes
0
answers
168
views
SoX fails to concatenate *some* newly generated aiff files
I have a Python script that is using Mac OS X's built in speech synthesis API to create aiff files of some processed text via PyObjC/AppKit. Everything is working fine, but I can't get the aiff files ...
2
votes
0
answers
1k
views
sox error on white macbook 1.1 no default audio device
I want to use a white macbook which purpose is recording sound with sox. I installed sox and lame via brew but when I want to record something in terminal
sox -d ada.mp3
I got the following error ...
1
vote
2
answers
647
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?
1
vote
1
answer
1k
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
1
answer
3k
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
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&...
1
vote
1
answer
5k
views
How do I install SOX on UBuntu 11.0 with all format supported packages?
I tried to install SOX ( Swiss Army knife of sound processing programs ) on Ubuntu 11.10. At first, I tried with apt-get install sox, it installed successfully but it couldn't convert wav to mp3. Then ...
1
vote
1
answer
2k
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 ...
1
vote
1
answer
8k
views
Convert GSM audio file to G.729
How can I convert GSM sound files to G.729 format? I've used Sox in the past for transcoding sound files, but have not been able to find a way to transcode to G.729. Using Sox, I have found a way to ...
1
vote
2
answers
4k
views
Run SOX batch on files in a relative folder
I have a windows batch script that runs a SOX command on various files, but I don't know how to get the batch to run on files in a relative path to that of the SOX executable. Currently all the files ...
1
vote
1
answer
2k
views
how to remove clipping from audio using sox?
i am looking to use -G or -v to limit a track's volume to avoid clip.
sox audio1.wav -G audio2.wav
or
sox audio1.wav -n stat -v
1.000
sox -v 1.000 audio1.wav audio2.wav
but nothing works as ...
1
vote
1
answer
392
views
How to embed multiple audio files to one video file with timeline offset?
I have a video file:
screencast.mpg (100sec)
And several audio files(file name indicate offset):
10.wav (10sec)
30.wav (5sec)
45.wav (8sec)
How can I combine those files together:
V:||||||||||||||...