Copier un CD de musique en MP3 ou Flac

CD -> WAV : cdparanoia -d /dev/hda -B
WAV -> MP3 : lame --vbr-new --preset extreme a_file.wav a_file.mp3
*.WAV -> MP3 : for x in `ls *.mp3`; do lame --vbr-new --preset extreme $x "`basename ${x} .wav`.mp3"; done; [1]
*.WAV -> MP3 in parallel : find . *.wav -print0 | xargs -0 -P $((`nproc` / 2)) -I {} lame --vbr-new --preset extreme {} {}.mp3 rename 's/\.wav\.mp3$/\.mp3/' *.mp3 [2]
*.WAV -> FLAC : flac --replay-gain --best *.wav
*.WAV -> FLAC in parallel : find . *.wav -print0 | xargs -0 -P $((`nproc` / 2)) -I {} flac --replay-gain --best "{}"

Notes

[1] --print0 / -0 options replace space by zeros at file name ends to deal with spaces in file names ; backticks call a sub-command ; basename isolate main part of name from extension

[2] $(()) for math operations ; backticks nproc for CPU number ; rename files in a second time