How to downsample FLAC files from 24-bit to 16-bit

This guide will explain how to convert 24-bit lossless FLAC files into either 16-bit/44.1kHz or 16-bit/48kHz FLAC files using SoX. When downsampling files it is good practice to downsample to a common multiple to avoid artifacts.

For example:

88.2KHz or 176.4KHz to 44.1KHz (88.2 / 2 = 44.1) or 176.4 / 4 = 44.1)

96KHz or 192KHz to 48KHz (96 / 2 = 48) or 192 / 4 = 48)

First off download SoX from HERE.

Once installed create a new .txt file on your computer in notepad and choose either of the following:

For 16-bit / 44.1 KHz output use:

@ECHO OFF
set sox="C:\Program Files (x86)\sox-14.4.2\sox.exe"
%~D1
CD %~DP1
MKDIR converted
@ECHO ON

FOR %%A IN (%*) DO %sox% -S %%A -G -b 16 "converted/%%~nxA" rate -v -L 44100 dither
@echo Downsampled using SoX v14.4.2: sox input.flac -G -b 16 output.flac rate -v -L 44100 dither>"converted/downsample-log.txt"

@PAUSE

This setting uses the following SoX command:

sox input.flac -G -b 16 output.flac rate -v -L 44100 dither

For 16 bit / 48 KHz output use:

@ECHO OFF
set sox="C:\Program Files (x86)\sox-14.4.2\sox.exe"
%~D1
CD %~DP1
MKDIR converted
@ECHO ON

FOR %%A IN (%*) DO %sox% -S %%A -G -b 16 "converted/%%~nxA" rate -v -L 48000 dither
@echo Downsampled using SoX v14.4.2: sox input.flac -G -b 16 output.flac rate -v -L 48000 dither>"converted/downsample-log.txt"

@PAUSE

This setting uses the following SoX command:

sox input.flac -G -b 16 output.flac rate -v -L 48000 dither

Name the file whatever you like, for example “downsample.bat” and save in a directory of your choice.

Click on the file and press F2 to rename or you can also right click and select “Rename“.
It is important to change the file type to a .bat file rather than .txt file.

Edit the second line of the script, replacing the path to sox.exe between the quotes with the SoX path that is correct on your computer.

Now you are ready to convert some files.

Drag and drop a .flac file or multiples onto the icon for the .bat file. The script will popup as shown in the screenshot below and begin converting the selected file(s).

Once the script has finished the newly downsampled files will be located in a sub folder called “converted” along with a log file called “downsample-log.txt“.

Share this post: