Questions tagged [sox]

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

SoX is a command line utility that can convert various formats of audio files to other formats. It can also apply various effects to these sound files as well as also playing and recording audio files.

36 questions
19
votes
4 answers

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 found here, namely for i in *.aif; do sox "$i"…
user47206
13
votes
6 answers

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 something like this : (sleep 10 ; play…
Ant's
  • 3,930
12
votes
4 answers

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 outputfilename Where $1 is the duration of the file…
LarryM
  • 587
6
votes
1 answer

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 want to install eboard with Synaptic, and it wants…
zetah
  • 9,871
5
votes
2 answers

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) $ rec -d hw:0,0 test.mp3 I've also tried…
Mittenchops
  • 1,640
5
votes
1 answer

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 there is a between 2 Hz to 20 Hz difference between…
Baard Kopperud
  • 1,064
  • 1
  • 13
  • 22
4
votes
3 answers

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, what it does is that it plays random songs…
Amir Shabani
  • 239
  • 2
  • 14
3
votes
3 answers

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 even if nobody is logged in? Thx [EDIT] the goal…
Sbe88
  • 133
3
votes
0 answers

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-asf to audio to further pass it to sox to pass if…
3
votes
2 answers

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 the silence only at the start and end of output.wav…
zey
  • 133
3
votes
2 answers

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 audio of my computer. I also prefer to…
Ahmad
  • 652
3
votes
1 answer

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 Encoding: n/a Channels: 1 @ 32-bit …
Pablo Bianchi
  • 17,371
3
votes
1 answer

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 at the length of primary. How can I make sox loop…
codekitty
  • 133
2
votes
2 answers

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 arecord -f cd -t raw | lame -x -r - out.mp3 which…
2
votes
1 answer

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 of this to a sound file? Thanks!
d3pd
  • 3,791
1
2 3