• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

sox: command not found

by admin

sox is the Swiss Army knife of audio manipulation, which is held in the package of the same name. Once installed, we can take a look at its man pages, where it is made clear that it can not only play an audio file, but it can also manipulate it! Here are the lines of code:

SoX reads and writes audio files in most popular formats and
						can optionally apply effects to them. It can combine multiple
						input sources, synthesise audio, and, on many systems, act as
						a general purpose audio player or a multi-track audio recorder.
						It also has limited ability to split the input into multiple
						output files.
All SoX functionality is available using just the sox command.
						To simplify playing and recording audio, if SoX is invoked as
						play, the output file is automatically set to be the default
						sound device, and if invoked as rec, the default sound device
						is used as an input source.
Additionally, the soxi(1) command provides a convenient way to
						just query audio file header information.
The heart of SoX is a library called libSoX. Those interested
						in extending SoX or using it in other programs should refer to
						the libSoX manual page: libsox(3).
SoX is a command-line audio processing tool, particularly
						suited to making quick, simple edits and to batch processing.
						If you need an interactive, graphical audio editor, use
						audacity(1).

As we can see in the preceding description, sox and soxi can be used for tons of different usages in manipulating audio files.

we can play a supported audio file format simply using these command lines:

# sox tone-sine-1000hz.wav -t alsa hw:2
tone-sine-1000hz.wav:
 File Size: 1.76M     Bit Rate: 1.41M
  Encoding: Signed PCM    
  Channels: 2 @ 16-bit   
Samplerate: 44100Hz      
Replaygain: off         
  Duration: 00:00:10.00  
In:78.9% 00:00:07.89 [00:00:02.11] Out:348k  [====|====] Hd:2.4 Clip:0

If involved files have no extensions at all, we can force the audio files using the -t option argument as follows:

# sox tone-sine-1000hz.wav -t au tone-sine
-1000hz
# file tone-sine-1000hz
tone-sine-1000hz: Sun/NeXT audio data: 16-bit linear PCM, stereo, 44100 Hz

If you encounter below error while running the soxi command:

soxi: command not found

You may try installing the below package as per your choice of distribution.

Distribution Command
OS X brew install sox
Debian apt-get install sox
Ubuntu apt-get install sox
Alpine apk add sox
Arch Linux pacman -S sox
Kali Linux apt-get install sox
CentOS yum install sox
Fedora dnf install sox
Raspbian apt-get install sox

sox Command Examples

1. Merge two audio files into one:

$ sox -m input_audiofile1 input_audiofile2 output_audiofile

2. Trim an audio file to the specified times:

$ sox input_audiofile output_audiofile trim start end

3. Normalize an audio file (adjust volume to the maximum peak level, without clipping):

$ sox --norm input_audiofile output_audiofile

4. Reverse and save an audio file:

$ sox input_audiofile output_audiofile reverse

5. Print statistical data of an audio file:

$ sox input_audiofile -n stat

6. Increase the volume of an audio file by 2x:

$ sox -v 2.0 input_audiofile output_audiofile
soxi: command not found

Filed Under: Linux

Some more articles you might also be interested in …

  1. update-alternatives: command not found
  2. checkinstall: command not found
  3. Introduction to sed (Stream Editor) : Useful sed Command Examples
  4. How to use “btrfs scrub” command to manage scrubbing on Btrfs file systems
  5. elinks Command Examples in Linux
  6. pmap: command not found
  7. grub-bios-setup: command not found
  8. How to Install and Configure Kerberos in CentOS/RHEL 7
  9. mountstats Command Examples in Linux
  10. lastlog: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright