I would like to produce (nearly) perfect FLAC files by verifying/checking all conversion steps. I'm hoping to do this in a single command, although a short bash script would be acceptable as a second choice.

I am on Kubuntu 12.04 and I installed flac 1.2.1.

Here is my starting point:

find ~/Music -type f -iname "*.wav" | while read fn; do flac --keep-foreign-metadata --ogg --verify "$fn"; done

How can I improve this?

If shntool is recommended, how would I include it?

How would I include checksum comparisons?

How can I make FLAC test the integrity of each file?

A working example is appreciated.

BTW, I took a look at perfect-flac-encode, but it is too complicated for me. I don't even fully understand the first sentence of the project's description! The installation steps also look too complex. If there is a similar project that might fit my needs, please let me know.

  • I think that you don't need FLAC, since the source is already lousy and using FLAC will just bloat the files. Try using the raw sources, instead wav files, to get the best quality.
    – Braiam
    Commented Aug 4, 2013 at 5:54
  • 3
    @Braiam: WAV is just a container which could carry both lossy or lossless audio data. In fact very often it is used for storing lossless PCM audio. Commented Aug 4, 2013 at 10:59
  • I have the original music CD's as well. My goal is to rip lossless FLAC music from these CD's. It is as simple as that. Thanks.
    – MountainX
    Commented Aug 4, 2013 at 19:04
  • I found an even better way to check the technical data of an audio file. See updated answer.
    – landroni
    Commented Dec 25, 2014 at 23:22
  • 1
    For ripping CDs into FLAC files, use abcde ( = a better cd extractor )
    – stonux
    Commented Jul 3, 2019 at 20:50

1 Answer 1


Both WAV and FLAC formats are lossless, which means they do not lose any quality from an original music CD. WAV however is uncompressed, while FLAC uses a lossless compression mechanism (pretty much like a ZIP lossless compression) specifically designed for efficient packing of audio data. FLAC files can then be played with your favorite player, just like ordinary MP3's.

If you already have WAV files, then you simply need to convert them to FLAC (and not worry about losing quality). You can either use CLI via SoX (although other solutions exist, like flac itself):

sox track_01.wav track_01.flac

Or use a clean and intuitive GUI like SoundConverter. In Preferences set output format to FLAC, choose compression speed (it does NOT affect quality, only resulting file size), then add files or a directory and start the conversion process.

enter image description here

Once the conversion is done, you can check that no quality was lost by using soxi (comes with SoX):

soxi track_01.wav 
soxi track_01.flac

The FLAC file size will be smaller though.

An even better way to check the technical data of an audio file is MediaInfo. See:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .