Grimoire-Command.es

GNU+Linux command memo

Resample FLAC music using sox keeping metadata

Descendre la fréquence d’échantillonnage et la résolution d’une piste audio FLAC

Exemple : 24 bits / 96 kHz → 16 bits / 48 kHz

1. The sox command

$ sox -S <original-flac-file> -r 48000 -b 16 <final-flac-file>  (1) (2)
1 The sox command comes from the sox package.
2 The <final-flac-file> must have a .flac extension for sox to infer the destination file format.

2. Practical case for an album

$ cd the_album/
$ find . -name "*.flac" -print0 | xargs -0 -P 4 -I {} sox -S {} -r 48000 -b 16 "{}.sox.flac"
$ rename -f 's/\.sox\.flac//' *.flac