Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sox]

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

0
votes
0answers
5 views

SOX split audio in noise between the sentences

How do I split audio files in SOX? RMS Speech level = -30dB RMS Noise in and between the sentence = -40 - -45dB I have tried to use various example of "Split audio on silence but keep silence" by ...
1
vote
1answer
81 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 ...
2
votes
1answer
27 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=...
0
votes
1answer
93 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. ...
0
votes
1answer
160 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 ...
1
vote
0answers
21 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-...
1
vote
3answers
877 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 ...
2
votes
1answer
1k 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?
3
votes
2answers
4k 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 ...
1
vote
1answer
1k 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 ...
2
votes
3answers
220 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 ...
2
votes
1answer
52 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. ...
0
votes
1answer
145 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 ...
1
vote
1answer
270 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 ...
1
vote
1answer
2k 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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
245 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 ...
0
votes
1answer
281 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 ...
1
vote
2answers
800 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 ...
0
votes
1answer
87 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?
3
votes
1answer
618 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....
0
votes
1answer
708 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 ...
1
vote
1answer
605 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
2
votes
1answer
1k 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-...
3
votes
0answers
530 views

How do I calculate noise level of an audio file with ffmpeg?

Related questions on this site that unfortunately don't match my use case: Compare two audio files How to use sox or ffmpeg to detect silence intervals in a long audio file and replace them by zeros (...
4
votes
0answers
1k views

sound recording with motion?

I want to set up a daemon that starts recording video with sound when it detects noise or movement. There are tools that do that separately but can they be done at the same time? Can I set up motion ...
1
vote
0answers
135 views

How to make 'sox' recognize 'lame'?

I tried to build sox on MacOS with MP3 support. A few months back; I forget the details, but it either would not build that way, or afterwards it failed to accept MP3. So I tried what was in the ...
3
votes
1answer
120 views

Does altering the amplitude of an mp3 file, using sox, alter the signal?

I've just used sox to reduce the amplitude by 3dB on an mp3 file, because the song was playing back too loudly. I used sox input-file.mp3 output-file.mp3 gain -3 Does this processing alter the ...
1
vote
1answer
193 views

Sox stopping after a specific amount of bytes

My goal is to have a command line tool to record long multichannels wav files on a raspberry pi 3 (5 hours +, 18 channels). Audio interface is the Behringer XR18. The way to do this is of course via ...
1
vote
1answer
3k views

Split large amount of wav files to small parts

I have large amount of wav files (over 50 000) and I need to split every wav file to 10 second long parts. It's nearly impossible to do it one by one, so my question is: is there any way to do it in ...
5
votes
1answer
6k views

sox: Split audio on silence but keep silence

I've got multiple audiobooks that are stored in large mp3s. And I'm trying to split these large mp3s into multiple smaller files. I've found a tool that can detect silence in audio files and split ...
3
votes
3answers
826 views

Splitting the ordered list into sublists

I have a list of files with names prefix_0000.mp3 ... prefix_x.mp3, where max(x) = 9999. I have the bash script: ... sox prefix_*.mp3 script_name_output.mp3 # this fails because maximum number is ...
2
votes
0answers
692 views

SOX detecting silence when reading mp3 from url

I setup a nice utility to log and record scanner radio traffic and then remove silence using SOX. To record continuously I keep calling SOX with silence detection: function dosox() { /usr/bin/sox -t ...
1
vote
0answers
99 views

Highest sampling rate with SoX recording

What would be the highest sampling rate I can specify for recording in SoX? I have a microphone device incorporating a high speed sampling card. I would like to record signals at 16 bit and either ...
14
votes
1answer
9k views

Remove silence from audio files while leaving gaps

Currently we're using this command within a shell script to remove silence from audio files: ffmpeg -i $INFILE -af silenceremove=0:0:0:-1:1:${NOISE_TOLERANCE}dB -ac 1 $SILENCED_FILE -y This works ...
2
votes
1answer
363 views

Shuffle Using SoX?

Is there anyway to shuffle songs using play on a folder using SoX? play ~/Music/*/**
3
votes
2answers
8k views

sox in between two pipes

I'm trying to put the "sox" utility in a two pipes command to resample a mono 44kHz audio file to a 16kHz audio file. It works fine with a single pipe : $ speexdec toto.oga - | sox -V -t raw -b 16 -...
3
votes
1answer
8k views

Sox: Convert the .wav file with required properties in single command

I have an test.wav file. I need to use this file to process an application, with following properties i) monochannel ii) 16khz sample rate iii) 16bit Now, I'm using following commands to attain ...
0
votes
0answers
464 views

How to upgrade SoX to the latest version on RedHat?

I've just installed SoX on RedHat using yum. It automatically installed v14.2.0 which is not the latest version. When I ran yum --showduplicates list sox to check the available packages, it shows ...
2
votes
1answer
1k views

Can I record sound until silence OR a maximum length of recording?

Looking at detecting sound until some silence occurs, I arrived at the command rec recording.flac rate 32k silence -l 1 0.1 3% 1 3.0 3%. I realize my specific use would be somewhat different: I do ...
2
votes
0answers
465 views

Need a script for automation the convert a lot number audio files to another format [closed]

I have a lot number audio files in MP3 the proprietary format, I want to convert them to 'opus' the free and high quality format, with keep metadata also. My selection command-line programs are SoX (...
4
votes
0answers
906 views

Default input device sox

I'm trying to configure sox to use a webcam that I just ordered. I've confirmed that the mic works through the GUI. I ran arecord -l and found that the card, device numbers are 1 and 0, respectively. ...
2
votes
1answer
1k views

Generating a long sound file with SOX without actually playing the tone

I know how to play a tone for a specific amount of time using SOX. play -n synth 5 sin 347 I know how to save a tone using SOX. sox -n note.mp3 synth 5 sin 347 Question is : How can I save a ...
2
votes
1answer
1k views

Create SOX batch script to extract first 15 seconds and rename multiple files in folder

I have a folder with several MP3 files that I need to extract 10-15 seconds of audio from. I would also like to rename these by appending sample-(name).mp3 to the converted files. How can I do this ...
2
votes
2answers
5k views

How to create the spectrogram of many audio files efficiently with Sox?

I have a bunch of audio files and I would like to create the spectrogram for each individual file using Sox. Usually, for a single file, I do this: sox audiofile.flac -n spectrogram However I don't ...
3
votes
1answer
2k views

How to use sox or ffmpeg to detect silence intervals in a long audio file and replace them by zeros (aka suppress background noise)?

I have a long audio file that was created by concatenating many short files. I would like to detect silence between the speech segments (just a threshold is enough for my purposes) and replace them by ...
2
votes
0answers
845 views

Playback and simultaneous recording through external USB sound card

I've an external USB sound card (in my case it's a TerraTec Aureon 7.1 USB). I've looped the earphone-out to the line-in using a 3.5mm jack cable. I'm interested in starting the playback of a MP2 ...
0
votes
1answer
784 views

Unix - Addressing filename with space for script [duplicate]

I have files Deep.flac and A1 - Rolling In The Deep.flac I wrote the script below, however it can only work with Deep.flac It cannot seem to work with filenames with spaces. I am learning unix system ...
2
votes
2answers
2k views

Play a sound file slower or faster

How can you play a sound slower or faster? That would be useful for listening carefully one audio passage or to listen fast forward to find a concrete passage. Is there something with the play sox ...
1
vote
1answer
373 views

Play last few seconds of mp3

Is there any way to play last N seconds of an mp3 file on bash commandline?