Releasing flac_recompressor Python Script

Releasing flac_recompressor Python Script

Hi everyone,

In the past few days, I’ve been working on a script that will attempt to get the smallest FLAC file size possible.

I’ve been playing around several FLAC encoder options and determined that by changing the block size, it is possible to get a smaller file size. However, it seems that depending on the audio file, we may need to use try different block size combination in order to get the smallest size, and this is what this script does.

The block sizes this script attempts to use are 512, 1024, 2048, 4096, 8192, and 16384. It then keeps the smallest file and removes the others. Do note that this tool will create non-compliant files, which may fail to play back on some software or hardware. However, they work on my Hiby R3 perfectly.

Other parameters used are the following:

flac -8 -b {} -f -e -p -m -r 0,15 -l 32 --lax "{}" -o "{}"

Where we pass the block size to the -b parameter.

To use it, simply pass a folder with music files to the -i argument and an output folder to the -o argument. The encoding process will then begin after pressing Enter.

You can get this script by cloning the git repository here.

Enjoy!