Sox sample rate manipulation

0 Members and 1 Guest are viewing this topic. Read 1654 times.

toddbagwell

Sox sample rate manipulation
« on: 26 Jan 2012, 09:10 pm »
How to use SoX to change audio file sample rates  :thumb:

I had a few files from HRx that were 24 bit  / 172.4 kHz that I needed to convert to to 96kHz or less due to a hardware limitation in my system.

A quick bit of Googling turned up SoX, but i couldn't find out how to use it.  :scratch:

After a little more searching, I was able to figure it out, and I figured I'd post a little How-To here for anyone else who wanted to play around with the program.

******************************************************************************

First- get SoX from http://sox.sourceforge.net/

Second- Install on your machine

Third- Open the folder you installed the program to and edit your batch file to include the settings you want to use with your file conversion.

See the html documentation file at [ http://sox.sourceforge.net/sox.html ] for descriptors of the programs features.

Right click on "batch-example" in your SoX folder and select "open"

The very end of the file shows the commands that will be applied to whatever file you input by dragging and dropping.

you should see the following near the bottom of the file:
C:\sox-14-3-2>for %A IN ((null)) DO sox %A "converted/%~nxA" rate -v 44100

This is the line of code that will take any audio file and convert it to 44.1 kHz with "Very good" quality conversion.

In addition to the level of quality, you can adjust various other settings such as filter bandwidth, aliasing and phase.

I ended up using: rate -v -M -b 94 -a 88200, which took my unplayable 172.4khz files and down-sampled them to 88.2 khz  :green:

Now that you've set up your SoX conversion settings, it's time to convert the files.

Fourth- Drag and drop your files into your batch file in the folder in which you installed SoX

Fifth- there is a folder named "converted" where SoX output is saved. open this and confirm it has the properties you wanted.

Sixth- Enjoy! I found that I needed to re-embed my album art following the conversion, which was not a big deal.






Hope this helps someone. I didn't know nearly enough about the command line and batch files to feel this was intuitive at all.

Later,
Todd