Skip to main content

Questions tagged [sox]

SoX - Sound eXchange is an Open Source command line utility that manipulates audio sound files.

Filter by
Sorted by
Tagged with
1 vote
1 answer
58 views

Have to source file after terminal is open for function to work

I am trying to make a terminal prank that plays noise for every output that happens on the terminal: exec > >(tee >(while true; do while IFS= read -r line; do FREQ=$(echo "$line&...
christopolise's user avatar
0 votes
1 answer
579 views

Troubles recording a sound using SoX with options - can't encode 0-bit Unknown or not applicable

I recently tried to record a sound using the onboard mic of my Dell Precision 3571 running on Ubuntu 22.04, with the sox command and a precise set of options (default sound card, 2 channels, 192 kHz ...
Lucbrst's user avatar
1 vote
0 answers
215 views

Is there a way to make a "sound" surveillance script?

I'm looking a way to built something like a sound surveillance box. I mean something that records audio/video on sound events captured by microphone. For example it should record 5 seconds audio/video ...
BiosRootKit's user avatar
12 votes
4 answers
4k views

How to remove last 4 seconds of MP3 file?

I have a set of MP3 files that I would like to remove the last 4 seconds. I know that if I know the time duration of each file I can do: ffmpeg -t ${1} -i inputfilename -acodec copy -vcodec copy ...
LarryM's user avatar
  • 568
2 votes
0 answers
334 views

How can a spectrogram of a sound be plotted between a defined upper and lower frequency bound?

I would like to plot a spectrogram of a sound between a range of frequencies, specifically from 0 kHz to 2000 Hz. Using SoX (sox sound.wav -n spectrogram -x 1000 -y 800), I have been able to make a ...
BlandCorporation's user avatar
1 vote
1 answer
775 views

How can I redirect sox messages to null or a log file

I run the following command to capture the output of audio into a file: $ sox -t pulseaudio alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -t mp3 test.mp3 silence 1 0.1 3% 1 3.0 3% > /dev/null ...
Ahmad's user avatar
  • 642
3 votes
2 answers
5k views

How can I record the audio output using sox?

I want to record the output of Google Text to speech to a mp3 file. I need a command that I can use in Terminal. I read sox can record audio, however don't know how to set up it to record the output ...
Ahmad's user avatar
  • 642
1 vote
0 answers
2k views

How to convert all mp3 audio in a folder to 8d or 9d audio in ubuntu terminal

In ubuntu terminal, is there any command to make all mp3 in a folder to 8d or 9d audio. Something like ffmpeg or other? According to mashable, 8D audio is essentially an effect applied to a stereo ...
Justine Chacko's user avatar
2 votes
0 answers
2k views

Finding a functioning voice changer for Discord on Ubuntu?

I've been trying to find (or make) a voice changer for a project I have with some friends for a tabletop gameover Discord, which includes role-playing. Thing is, I can't find any real-time voice ...
LihuelWorks's user avatar
2 votes
0 answers
157 views

Can a symbolic link provide default arguments?

I'm playing around with the SoX, an audio conversion program. After installation I notice that it creates a symbolic link /usr/bin/play -> sox. I notice that I can play an audio file with play ...
roro's user avatar
  • 267
3 votes
1 answer
2k views

CLI line buffer: How to pipe to grep an output stream?

I have this command (for pomodoros): play -n synth 25:00 pinknoise I don't want to silent completely the output (-q option), just the header (grep don't work). Normal output: File Size: 94.3T ...
Pablo Bianchi's user avatar
1 vote
1 answer
2k views

Convert .gsm to .wav with sox

I'm trying to convert one music files with format .gsm to format .wav. This is how I tried: for f in *.gsm; do sox $f new/${f%.wav}; done The result is that I get the same files with the same format ...
S.I.'s user avatar
  • 403
2 votes
1 answer
696 views

I would like to give the crontab command priority over current audio stream Ubuntu 18.04

The mp3 will automatically run at the specified time using crontab. */10 7-21 * * * play /home/mo/document/1.mp3 */10 7-21 * * * sleep 20;play /home/mo/document/2.mp3 */10 7-21 * * * sleep 40;play /...
짱구신's user avatar
3 votes
1 answer
2k views

How do I add mix in audio from one file to a another

I'm trying to add background audio to a primary wav file. sox -m primary.wav background.wav output.wav I have about 5s of background chatter in background.wav and I'd like the output to always be ...
codekitty's user avatar
  • 133
2 votes
2 answers
1k views

Error Loading SoX

I use a really useful tool called r128gain which performs loudness normalisation on audio files. Under 17.10, however, I get the following error however... Failed opening "/home/Downloads/r128gain-1....
Steve Brodie's user avatar
1 vote
2 answers
147 views

How to find out which songs in a directory are loudest?

Backstory: I have about 400 odd songs that I use for background music in my wikipedia audiobooks. I had thought I had normalized them all properly so their volume would not overwhelm the speech, but ...
Anon's user avatar
  • 12.2k
3 votes
3 answers
5k views

How to play sound on our local server through ssh without logging in on that server?

I'm using sox to play a sound on our local server (ubuntu 16.04). I run play myfile.mp3 through ssh. However, that sound only plays if I'm logged in on that local server. Any idea how to achieve this ...
Sbe88's user avatar
  • 133
4 votes
3 answers
3k views

Write the dynamic output of terminal into a text file

It comes down to being able to save the dynamic output (I'll explain) of terminal into a text file, but here's what I'm ultimately seeking. I created a custom command for terminal called playRandom, ...
Amir Shabani's user avatar
0 votes
1 answer
904 views

How to stop all "play" commands currently running in other shells? [duplicate]

I have a script that invokes the play command when I press f10. I would like to edit that script so if I press it while an audio file is playing, then it kills that first before playing the next file. ...
Anon's user avatar
  • 12.2k
1 vote
1 answer
546 views

How to prevent wrong audio file tag encoding after using SoX?

SoX changes tags. The title is changed from 4 марта to 4 маÑÑа. The SoX command is simple sox f.mp3 f2.mp3. How to prevent wrong audio file tag encoding after using SoX?
max5555's user avatar
  • 327
0 votes
1 answer
2k views

Is there an easy way to kill a 'play' job (from sox)

I use the play utility from the sox package to generate noise so that sirens won't wake me up at ungodly hours! However play runs like a daemon, meaning that pressing Ctrl+C will not stop it. So I ...
Reza's user avatar
  • 1,245
5 votes
2 answers
7k views

sox and rec without the mic

I'm trying to record the output of my speakers, but when I do this, it also records from the microphone. I'd like to only record the non-microphone devices. Trying: $ (AUDIODEV=hw:0,0; rec test.mp3)...
Mittenchops's user avatar
  • 1,640
1 vote
0 answers
268 views

Generate the sounds of a babbling brook or a water-fall with SoX?

I got so inspired by this question "Generate White Noice to Calm a Baby", so I was wondering what else i possible to do with SoX... Is it possible to generate the sound of a babbling brook? Is it ...
Baard Kopperud's user avatar
5 votes
1 answer
1k views

SoX suggestions - Binaural Beats?

I got so inspired by this question Generate white noise to calm a baby, and was wondering if SoX could be used for generating Binaural Beats. Basically I'd want to make sounds that are such that ...
Baard Kopperud's user avatar
3 votes
0 answers
348 views

Convert stream video/x-ms-asf to audio and pipe it to stdin of sox

Short story I'm trying co convert something which seems to appear a video stream (to be precise it's a FM radio streamed to the internet via http://stream.polskieradio.pl/program3) of type video/x-ms-...
Marian Paździoch's user avatar
2 votes
2 answers
3k views

How to record with sox?

I would like to record some text-to-speech. Right now I pipe the audio to play so that it can be played. The command that I use to play the tts is play -q - I have tried using audio-record and ...
user252836's user avatar
3 votes
2 answers
19k views

combine multiple audio files with slience between each audio file in sox

I have about 20 audio files(.wav) in a folder , this is how I combine this wave files sox *.wav output.wav I want to add delay or silence between each wave . I have tried pad , but it's just put ...
zey's user avatar
  • 133
0 votes
1 answer
1k views

Is there a way with sox to trim parts of audio file with volume under a certain level?

I have an audio file and I want to delete the parts of this audio file that have less than a certain level of volume. Is that possible with sox?
Amk's user avatar
  • 101
0 votes
1 answer
2k views

Cross fading several audio files using sox

I'm trying to cross-fade several audio files together with a 3 second cross-fade and join them together in to one file with sox. I can join several files together by the command below but not sure ...
Rick T's user avatar
  • 2,253
2 votes
1 answer
2k views

output SoX synthesized sound to file

I have the following SoX command that generates a nifty 'spacecraft' sound: play -n -c1 synth whitenoise band -n 100 20 band -n 50 20 gain +25 fade h 1 864000 1 How could I output about 10 seconds ...
d3pd's user avatar
  • 3,741
0 votes
1 answer
74 views

Command substitiution problem, confused

I am trying to have sox play a file from user input. To do this, I set up a command like the one below: $ play proc/$(read -n 1).wav I have files 0.wav through 9.wav located in the directory proc. I ...
user530873's user avatar
19 votes
4 answers
21k views

How to convert .aif audio files to mp3?

I have audio files with .aif extensions (AIFF/Amiga/Mac audio). How to play them and, more important: how to convert them to mp3 or other more common audio format? update: trying to run a command ...
user avatar
2 votes
1 answer
2k views

Batch split large FLACs to mp3 using sox or similar

I have about 50x 1 hour long flac files (audiobooks), each of which I need to encode into (approx.) 10 minute long segments at a convenient silence point (+ or - 30 seconds either side of 10 minutes). ...
abssorb's user avatar
  • 55
13 votes
6 answers
21k views

How can I play a song in the background via my command line?

I have installed play : sudo apt-get install sox libsox-fmt-mp3 I can now play my audio files like this : play Desktop/SONGS/01\ -\ Oh\ Baby\ Girl.mp3 Since I'm learning shell, I wish I could do ...
Ant's's user avatar
  • 3,910
6 votes
1 answer
301 views

Injecting packages installed from source into apt/synaptic

Example: I build/install SoX myself, as provided Ubuntu package did not include additional audio format libraries that I might use and it's one of the packages I want latest version anyway. Now I ...
zetah's user avatar
  • 9,813