18

I am installing sox in windows, but I get an error entering the following code: sox 001.wav 001.dat in the command line.

The error is:

`sox is not recognized as an internal or external command, operable program or batch file.`
Jota
  • 17,281
  • 7
  • 63
  • 93
MSI
  • 681
  • 1
  • 7
  • 12

3 Answers3

29

Add the Sox folder to your PATH and then restart your terminal.

  1. Go to My Computer → Properties → Advanced System Settings → Environment Variables → System variables.
  2. Select Path.
  3. Click Edit → New :
  4. Add this: C:\Program Files (x86)\sox-<CHECK YOUR VERSION NUMBER>\
    • As indicated in the example path, make sure to check what version of Sox you have installed by actually navigating to your Program Files (x86) folder and looking for a folder that starts with sox, for example sox-14-4-2.
  5. Restart your terminal.
    • Note that if you're using an IDE, you may need to restart the IDE to have the Path variables update.
Nathan Wailes
  • 9,872
  • 7
  • 57
  • 95
MSI
  • 681
  • 1
  • 7
  • 12
  • You can do this also (temporary) in the console: `set PATH=C:\where-my\sox-is;%PATH%` – tvw Jun 13 '18 at 13:27
  • Step 3 (Click Edit --> New:) doesn't work in my Win7 laptop. Clicking on Edit --> pop-up with 2 Fields: "Variable name:" & "Variable value". Presumably a semi-colon (;) and the text to be added (see Step 4 of Answer) has to be appended onto the value already in the "Variable value" field. – steveOw Aug 15 '18 at 14:33
3

I entered my sox directory folder and used './sox' command instead of just 'sox' and it worked.

azizbro
  • 3,069
  • 4
  • 22
  • 36
0

Not sure if this will be approved of but... I open the command line and navigate to the folder containing sox. For me this is:

‪cd C:\Program Files (x86)\sox-14-4-2\

To get this just find the sox.exe file, right click on it and copy the full file path shown as the 'Object Name' the top of the security tab just omitting the 'sox.exe' file name. enter image description here

I then put the files I want to convert in that folder (ensuring there are no spaces in the file names - as there often are with music files). This makes the file paths for the files being processed and the naming of the output file much easier to handle. e.g. If I'm using the CD de-emphasis filter the command would look like this:

sox.exe Music.wav Music_deemph.wav deemph

This takes the Music.wav file, processes it and places the processed file I have named Music_deemph.wav in the same folder. Possibly not ideal to be messing around in the program folder by placing the files being processed in there, but for those of us who don't use the Command Line that often it makes things a little easier, as the instructions are far less verbose. The above command would read as follows if I left the music file in its original folder:

sox.exe C:\Users\David-PC\OneDrive\Music\Music.wav C:\Users\David-PC\OneDrive\Music\Music_deemph.wav deemph
SteelyDanFan
  • 79
  • 4
  • 12