Skip to main content

Questions tagged [sox]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
58 views

Playing a sound every 15 minutes at a specific volume

I have monitor speakers that go into a sleep state when they don't receive a certain level of sound input. The speakers often turn off when I am watching/listening to something quietly. To remedy this,...
keenwa's user avatar
  • 1
0 votes
0 answers
499 views

Low-latency realtime sound filtering with Pulseaudio and Sox

I'm using Linux for audio experimentation, so PulseAudio and ALSA. I'm having trouble achieving a consistent low latency. I had an idea that I could cover up unwanted environmental noises (such as ...
Metamorphic's user avatar
  • 1,199
0 votes
1 answer
66 views

Capture output from SOX "-n stat"

I am trying to capture/pipe the output from the following: arecord -f S16_LE -qd 5 file && sox file -n stat output: Samples read: 8000 Length (seconds): 1.000000 Scaled by: ...
Mark Miller's user avatar
2 votes
1 answer
490 views

Why does `read` fail saying "read error: 0: Resource temporarily unavailable"?

script #!/bin/bash -- # record from microphone rec --channels 1 /tmp/rec.sox trim 0.9 band 4k noiseprof /tmp/noiseprof && # convert to mp3 sox /tmp/rec.sox --compression 0.01 /tmp/rec.mp3 ...
Pound Hash's user avatar
-1 votes
2 answers
183 views

How to fade out batch wav files?

I need to apply a fade out of 2 seconds on a batch of wav files (with names including spaces like C 0 120-127.wav). The files length varies, but I need a fade out of 2 seconds from the end of each ...
black-clover's user avatar
1 vote
1 answer
53 views

How to extend sustain in batch wav files?

I have a batch of sound samples which are too short (2.15 sec), and I want to extend the sustain to a total of about 10 seconds, meaning stretch the last 0.50 second of the file to 10 seconds. I can ...
black-clover's user avatar
0 votes
1 answer
88 views

How to bulk edit wav files?

I need to cut off the first say 3 seconds from a batch of wav files. Is there a way to do it from the command line or using a linux native program? Thanks.
black-clover's user avatar
1 vote
1 answer
48 views

Divide frequency of live audiostream from an ultrasound microphone

I want to record ultrasound with a microphone, divide the frequency and listen to the transposed sound. I start with a normal microphone for tests. I tried sox with rec and play so far. It works, but ...
Jonas Stein's user avatar
  • 4,138
3 votes
0 answers
779 views

How to record audio device with more than 2 channels using SoX?

I have multiple USB audio interfaces that each have 10, 18 or even 32 input channels. Mainly used to record every instrument of a band into a separate track. I record in raw wav format (s32le @48kHz) ...
Forivin's user avatar
  • 897
0 votes
0 answers
192 views

Find the peak frequency in Khz of audio file using sox or python for mp3 flac and wav files

I wanted to batch analyze audio files for peak frequencies using python or SoX Above spectrogram are created using sox I wanted to extract peak frequency like in image 1: 20Khz
Arjun's user avatar
  • 1
-1 votes
1 answer
189 views

sox: How To Trim Audio From a .mp4

using sox how do I remove 0:20-0:25 of a .mp4 file. So far I have sox filename filename2 trim 20-25
mister mcdoogle's user avatar
1 vote
1 answer
176 views

Gapless resampling with sox

I'm trying to use sox to resample a series of tracks that should be played back gaplessly. If I resample each track individually, I can sometimes end up with clicks at the track boundaries due to the ...
rkjnsn's user avatar
  • 702
1 vote
1 answer
699 views

FLAC encoders – any difference in output between the command-line tools?

I would like to know if there is any difference in the final output between the various command-line tools for encoding FLAC files, like ffmpeg, sox, the “official” flac etc. In some contexts, I have ...
fnix's user avatar
  • 63
1 vote
1 answer
291 views

Convert encode of audio files

I wish to convert the encoder of some audio files. The problem is that my car can't reproduce audio files encoded with LAME3.99.5; it's an issue with some Volvo cars. The problem is with USB and CD. ...
Unix's user avatar
  • 248
2 votes
0 answers
665 views

sox gives inconsistent results mixing stereo to mono

Whichever of the following ways of mixing stereo to mono I try repeatedly, the resulting files are always different (md5 hashes do not match): sox stereo.wav -c 1 mono.wav sox stereo.wav mono.wav ...
Greendrake's user avatar
1 vote
2 answers
1k views

Detecting sound / silence on a sox pipe?

I am trying to keep a sox pipe input from a sound card open and execute a player commend only when there is sound in the pipe (without killing the pipe or using a file). This could be easily achieved ...
nadigo's user avatar
  • 11
0 votes
1 answer
318 views

Why isn't sox recording anything?

I have an RTL-SDR radio receiver which outputs streaming data to stdout. I can listen to the audio with this command: $ rtl_fm -M wbfm -f 96.5M | play -r 32k -t raw -e s -b 16 -c 1 -V1 - As you can ...
OZ1SEJ's user avatar
  • 197
4 votes
1 answer
3k views

Could you explain the parameters "gain" and "reference" in the sox effect "loudness <gain> <reference>"?

SUMMARY: 1. I'd like to use the "loudness" effect in sox to set thirty mp3 files (containing songs) to the same loudness, before I burn them to CD. This is so that when my friend plays them, ...
dave99's user avatar
  • 49
1 vote
1 answer
114 views

Sox/Terminal is teling me 'Could not rewind in audio file'

I'm running this command on terminal: for i in $(ls -1 /home/pi/Desktop/Music/Acapella/*.mp3|sort -R); do sox -t mp3 $i -t wav - ; done | sudo ./pi_fm_rds -freq 102.1 -audio - -ps ZSFM -rt "...
horace's user avatar
  • 25
0 votes
2 answers
115 views

How to use a forloop on only the first part of a command

I have this .sh: #!/bin/bash cd /home/pi/Desktop/PiFmRds/src for f in $(ls -1 /home/pi/Desktop/Music/Acapella/*.mp3|sort -R); do sox -t mp3 "$f" -t wav -r 44100 - | sudo ./pi_fm_rds -freq ...
horace's user avatar
  • 25
1 vote
1 answer
143 views

Shuffle Files In A Dir With Sox (Endlesssly)

I have a directory full of mp3s - /home/pi/Desktop/Music - and I want to be able to shuffle all the songs in the dir, so when I use sox to convert them into wma files on-the-fly, they will all be ...
horace's user avatar
  • 25
1 vote
2 answers
2k views

How to resample audio on-the-fly with sox

If you answer I'll give you a cookie! I am using sox to convert MP3 files to a WAV on the fly for pifm. The only thing is, I am doing it to a whole directory of MP3s, and because not all of them have ...
KJs's user avatar
  • 23
0 votes
1 answer
114 views

Can I Shuffle Audio Files With SOX

I am using this command on my raspberry pi: sox -t mp3 /home/pi/Desktop/ribo.mp3 -t wav - | sudo ./pi_fm_rds -freq 94.5 -audio - Basically, it takes all the mp3 files in a directory and changes ...
PiWannabe's user avatar
0 votes
0 answers
6k views

Getting ALSA cannot find card '0' whilst trying to play audio files on my VPS Debian server

I am trying to play audio on a Debian server with sox. But I get these errors: ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4568:(_snd_config_evaluate) function ...
jnbdz's user avatar
  • 191
1 vote
0 answers
148 views

Noise removed but file duration reduced in SOX

I use sox for Noise removal/reduction from audio but when I give these commands, /usr/bin/sox input.wav -n noiseprof noise.prof /usr/bin/sox input.wav output.wav noisered noise.prof 0.2 output.wav ...
Yash Mistry's user avatar
2 votes
1 answer
2k views

split wav file into parts of equal duration, padding with silence if needed

I need to split wav files into multiple 10-second-long wav files, but each resulting wav file must be exactly 10 seconds in length, adding silence if needed – so if a wav file's duration in seconds ...
Eric's user avatar
  • 123
2 votes
2 answers
10k views

ALSA aplay mono file but returns channel count non available

I have a test.wav file that I wanna play through speaker using ALSA. I also have sox installed on the system. All sound cards are installed properly. aplay -L and arecord -L return the correct value. ...
Yihan Hu's user avatar
1 vote
0 answers
193 views

Is there a way to cut an audio file, from terminal, by the markers inside a WAV file?

I have to voice over 1000 words and each one must be saved to an independent audio file. I am using a microphone attached to the Zoom H5 recorder. Instead of recording 1000 words individually I intend ...
Duck's user avatar
  • 4,714
0 votes
0 answers
288 views

How can I run sox as a service?

I want to run the following bash for recording speaker output as an mp3 file using sox as a service in background (Ubuntu 20.04): #!/bin/bash echo "Monitoring sound card for recordings" name=...
Ahmad's user avatar
  • 113
0 votes
1 answer
638 views

sox FAIL formats: can't open input `alsa_output.pci-0000_00_1b.0.analog-stereo.monitor': can not open audio device: Connection refused

I wrote the following service to listen to the audio input: [Unit] Description=Monitor Audio Output After=syslog.target network.target plusaudio.service [Service] Type=simple ExecStart=sox -v 5 -t ...
Ahmad's user avatar
  • 113
0 votes
2 answers
1k views

sox command is automatically adding delay in the begining of mp3

I have a few video files which have "humm" sound in the audio. So, I created the following script for batch processing. I am using ffmpeg, to extract audio to .mp3, and sox to denoise, which ...
user3025253's user avatar
0 votes
1 answer
214 views

same command works in shell but not in crontab

I have a simple command play -V4 /folder/file.ogg on command line it works perfect on crontab * * * * * klaus play -V4 /folder/file.ogg it gets triggered ( i can see it in syslog) but I can't ...
Max Muster's user avatar
1 vote
1 answer
616 views

How can I play all of mp3s in a folder continously with sox

I use sox for play audio in my computer. I love it. But I don't know how to repeat all of my mp3s in a folder. play -R *.mp3 and play repeat 10 *.mp3 not works. After end of sequence it exited. ...
sarkiroka's user avatar
  • 113
0 votes
0 answers
617 views

Sox split .mp3 wav by silence

mp3 file with around 200 sentences. They are separated by silence of around 500-1000, but it is not fixed or equal. What is the best way to split to one file per sentence? Preferably with sox. I ...
Cranjis's user avatar
  • 101
1 vote
2 answers
5k views

normalize the volume level of an mp3 file with sox using maximum bitrate for the new file

I have lots of mp3 files that were set (by some buggy tool) to such a low gain level, that there is nothing to hear any more. This command for f in *.mp3; do sox --norm "$f" /tmp/sox.mp3; mv -v /...
rubo77's user avatar
  • 29.4k
0 votes
1 answer
249 views

Batch transpose

I would like to pitchshift multiple audio files into multiple pitches, 12 for each file. The following successfully pitchshifts one file: sox *.wav Examples_100.wav pitch 100 And the following ...
syntheso's user avatar
  • 101
1 vote
2 answers
467 views

What is the Hd output of SoX’s play?

When I use the play command provided by SoX, sometimes the playback information contains a number labeled Hd, which the manpage doesn’t seem to mention. What does it mean? $ play song.mp3 In:72.5% 00:...
bleistift2's user avatar
1 vote
1 answer
777 views

Split audio stream with sox and process chunks with script

I use sox for splitting audio stream like this stream | sox -t raw -r 16k -e signed -b 16 -c 1 - ./chunks/output.wav silence 1 0.3 0.1% 1 0.3 0.1% trim 0 55 : newfile : restart Now sox write chunks ...
Serhii Shliakhov's user avatar
3 votes
1 answer
1k views

Sox format for stream with sample spec 's16le 1ch 16000Hz', channel map 'mono'

I'm trying to pipe audio to sox and I get Error "sox FAIL formats: bad input format for `-': sampling rate was not specified" parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --rate=...
Serhii Shliakhov's user avatar
2 votes
1 answer
2k views

SoX - mixing two audio tracks but looping/repeating only one

I have two audio-files and want to mix them with SoX using the -m, --combine mix option. Both files have the same bpm, but not the same length, meaning I need to loop one file, but not the other. ...
nath's user avatar
  • 5,824
1 vote
1 answer
3k views

Sox stopped working

I'm using sox in this setup: sudo timeout 20 rtl_fm -f 115.5M -s 60k -g 45 -p 55 -E wav -E deemp -F 9 - | sox -t wav - test.wav rate 11025, it worked for quite a while but since last week it stopped ...
cy8berpunk's user avatar
1 vote
0 answers
287 views

How do I get Port level granularity when using Pulseaudio?

I'm trying to remove noise from a mic. pacmd list-sources shows analog-input-mic and analog-input-internal-mic However when i run pacat it only allows a device-spec name: <alsa_input.pci-...
putty's user avatar
  • 11
0 votes
1 answer
1k views

Getting the audio-playtime of a folder from the command line

Is there a way/tool for the linux command-line (bash) to get the overall audio playtime of a certain directory? Something like: playtime --all --recursive /Music/DrumAndBass/ output: 1:35:06
nath's user avatar
  • 5,824
1 vote
3 answers
3k views

How to use command output (ls) into other command's input (sox)?

I have a folder with multiple .wav files that I am trying to concatenate in order but I think that I am too inexperienced with bash commands to do this as efficient as possible. You see, I don't know ...
Bart's user avatar
  • 95
4 votes
1 answer
6k views

How to clear background noises with sox

Is it possible to convert a mp4 file to mp3 or flac, clearing background noises in the process? Or is it possible to run audacity totally trough shell, No GUI?
matisa's user avatar
  • 367
10 votes
3 answers
26k views

batch convert mp3 files to wav using sox

for a single .mp3, I can convert it to wav using sox ./input/filename.mp3 ./output/filename.wav I tried: #!/bin/bash for i in $(ls *mp3) do sox -t wav $i waves/$(basename $i) done But it ...
kRazzy R's user avatar
  • 269
3 votes
1 answer
8k views

Split audio into several pieces based on timestamps from a text file with sox or ffmpeg

I looked at the following link: Trim audio file using start and stop times But this doesn't completely answer my question. My problem is: I have an audio file such as abc.mp3 or abc.wav. I also have ...
DJ_Stuffy_K's user avatar
3 votes
3 answers
1k views

What is the minimal set of programs required to play something on my machines audio jack or S/PDIF output?

Problem: I don't hear anything on my sound system when playing audio. Question: What is the minimal set of programs required to play something on my machines audio jack or S/PDIF output? How did I ...
Multisync's user avatar
  • 474
2 votes
1 answer
82 views

Monitor microphone and save filtered segments

I use the following script to monitor my microphone: while true; do printf "$(AUDIODEV=hw:2,0 rec -n stat trim 0 1 2>&1 | awk 'BEGIN { ORS="" } /^Maximum amplitude/ { print "Max. ...
ka3ak's user avatar
  • 1,265
0 votes
1 answer
359 views

Silence out regions of audio based on time stamps passed to sox

My original question and indirect solution are here : https://stackoverflow.com/questions/48161567/silence-out-regions-of-audio-based-on-a-list-of-time-stamps-using-sox-and-pyth I have an audio A ...
kRazzy R's user avatar
  • 269