2022 Developer Survey is open! Take survey.

Questions tagged [sox]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
34 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. ...
user avatar
  • 180
1 vote
0 answers
76 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 ...
user avatar
1 vote
1 answer
69 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 ...
user avatar
  • 11
0 votes
0 answers
39 views

Detect microphone feedback sound

Can I use some audio software (like sox or something?), to detect microphone feedback noise on live audio? I want to make script, that can detecting feedback sound on live performances and then send ...
user avatar
0 votes
1 answer
67 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 ...
user avatar
  • 147
2 votes
1 answer
271 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, ...
user avatar
  • 29
1 vote
1 answer
47 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 "...
user avatar
  • 25
0 votes
2 answers
93 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 ...
user avatar
  • 25
0 votes
0 answers
143 views

Sox Is Throwing A Random Error: Option A Isn't Recognized

I am running this command: sox -t mp3 $(ls -1 /home/pi/Desktop/Music/*.mp3|sort -R) -t wav -r 44100 - | sudo ./pi_fm_rds -freq 104.5 -audio - -ps ZSFM -rt ZSFM This is the result: sox WARN getopt: ...
user avatar
  • 1
1 vote
1 answer
69 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 ...
user avatar
  • 25
1 vote
2 answers
488 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 ...
user avatar
  • 23
0 votes
1 answer
30 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 ...
user avatar
0 votes
0 answers
3k 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 ...
user avatar
  • 183
1 vote
0 answers
33 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 ...
user avatar
2 votes
1 answer
435 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 ...
user avatar
  • 123
2 votes
2 answers
4k 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. ...
user avatar
2 votes
0 answers
65 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 ...
user avatar
  • 4,204
0 votes
0 answers
118 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=...
user avatar
  • 113
0 votes
1 answer
329 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 ...
user avatar
  • 113
0 votes
2 answers
623 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 ...
user avatar
0 votes
1 answer
130 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 ...
user avatar
1 vote
1 answer
116 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. ...
user avatar
  • 113
0 votes
0 answers
326 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 ...
user avatar
  • 101
1 vote
2 answers
3k 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 /...
user avatar
  • 24.7k
0 votes
1 answer
139 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 ...
user avatar
  • 101
0 votes
2 answers
243 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:...
user avatar
1 vote
1 answer
457 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 ...
user avatar
  • 143
3 votes
1 answer
745 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=...
user avatar
  • 143
1 vote
1 answer
1k 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. ...
user avatar
  • 4,760
1 vote
1 answer
2k 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 ...
user avatar
1 vote
0 answers
222 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-...
user avatar
  • 11
0 votes
1 answer
517 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
user avatar
  • 4,760
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 ...
user avatar
  • 75
4 votes
1 answer
4k 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?
user avatar
  • 307
7 votes
3 answers
19k 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 ...
user avatar
  • 239
3 votes
1 answer
5k 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 ...
user avatar
3 votes
3 answers
794 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 ...
user avatar
  • 424
2 votes
1 answer
64 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. ...
user avatar
  • 1,151
0 votes
1 answer
300 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 ...
user avatar
  • 239
1 vote
1 answer
871 views

sox equivalent of silence removal in ffmpeg

If I have an audio file in .wav format, I can run sox on it as follows : sox in.wav out6.wav silence -l 1 0.1 1% -1 2.0 1% and this command works really really well for removing silence. Is there ...
user avatar
  • 239
2 votes
1 answer
10k views

sox convert raw audio to wav gives error although all option are defined [closed]

I have some raw audio data I try to convert with sox like this: sox -r 44100 -b 16 -c 1 -L -e signed-integer /infiles/recording.dat /outfiles/recording.wav this gives me the following error: sox ...
user avatar
  • 71
1 vote
1 answer
4k views

Audio from audio source to pipe (stdout/stdin)

I am trying to get an audio stream from Bluetooth to the stdin of fm_transmitter on my Raspberry Pi 3 / up-to-date Raspbian Stretch. So far, I got FM-Transmitter running with an ICE-Cast-Stream ...
user avatar
1 vote
1 answer
611 views

Remove silence from mp4

When my teacher gives a presentation in our class, it is recorded. The end result is that you have an mp4 file with the slides and the voice of my teacher. In most cases the first ten-15 ...
user avatar
  • 239
0 votes
1 answer
515 views

SoX - Mix original signal with effected signal

Is there an option in SoX effects processing to mix the wet and dry signals instead of only outputting the wet? For example, say my effects chain is overdrive into pitch shift: sox in.wav out.wav ...
user avatar
5 votes
5 answers
7k views

Programmatically change the playback speed (NOT pitch) in real-time

I'm looking for a software that reproduces audio files (wav and mp3 if possible) and provides a way to change the playback speed in real-time, flawlessy. I mean, without any gap, pop, or noise. Like ...
user avatar
  • 557
2 votes
1 answer
733 views

Play audio file from a certain time step in terminal?

I need a way in which I can play an audio file in the terminal, and tell it from what time step it should start from?.. Example could be to start the audio file from 00:10:00... is that possible?
user avatar
  • 93
3 votes
1 answer
1k views

How can I analyze a segment of an audio file with sox?

I wanted to analyze 5 seconds of an audio file beginning from 50 seconds. So I ran the following command: sox audio.wav -n stat trim 50 5 But the output contained: ... Length (seconds): 55....
user avatar
  • 1,151
0 votes
1 answer
2k views

Can't set mp3 sample rate to 44.1k using sox

I am trying to overlay two files (merge them into one so they plat simultaneously). The options for sox --combine are sequence, concatenate, mix, mix-power, merge, and multiply. I've looked at the ...
user avatar
0 votes
1 answer
2k views

Channel selection with sox

Assuming I only want one channel in the output file, is sox in.wav out.wav -c 1 equivalent to sox in.wav out.wav remix 1-n, n being the number of input channels
user avatar
  • 101
5 votes
1 answer
4k views

How to monitor microphone volume level?

I've found a solution that doesn't work by me: audio - Monitoring the microphone level with a command line tool in Linux - Super User https://superuser.com/questions/306701/monitoring-the-microphone-...
user avatar
  • 1,151