I want to convert my SACD collection that's in WV DSD to 16-bit 44.1 kHz FLAC for DAP use. I want the volume to be normalized by album basis.
Fastest way I've found is to use ffmpeg. Tags from WV is transfered to FLAC this way. First convert all files in folder with 0dB gain. Using sox resampler here (-precision 28 enables sox 'Very High Quality’. Linear phase is default.)
for i in *.wv; do ffmpeg -i "$i" -af "volume=0dB" -sample_fmt s16 -ar 44100 -resampler soxr -dither_method triangular -precision 28 -y "${i%.*}.flac"; done
Then use sox to find the Pk lev dB from converted files.
sox -S *.flac -n stats
Overall Left Right
DC offset 0.000309 -0.000007 0.000309
Min level -0.598694 -0.598694 -0.553558
Max level 0.591400 0.591400 0.551514
Pk lev dB -4.46 -4.46 -5.14
RMS lev dB -24.12 -23.94 -24.30
RMS Pk dB -15.46 -15.46 -15.81
RMS Tr dB -96.68 -96.68 -96.65
Crest factor - 9.42 9.08
Flat factor 0.00 0.00 0.00
Pk count 2 2 2
Bit-depth 16/16 16/16 16/16
Num samples 92.5M
Length s 2097.573
Scale max 1.000000
Window s 0.050
Done.
Then reconvert all the files with clipping free gain.
for i in *.wv; do ffmpeg -i "$i" -af "volume=4.2dB" -sample_fmt s16 -ar 44100 -resampler soxr -dither_method triangular -precision 28 -y "${i%.*}.flac"; done
I still would like to find a more automated way of doing this.