convert WAV music library to FLAC on command line and achieve best quality

29,931

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:

Share:
29,931

Related videos on Youtube

Jarek
Author by

Jarek

You may be interested in the story of SE moderator Monica Cellio and how she was unfairly treated by the corporate management of this site. More info here. An update is available. Let's hope we can cultivate a more fair environment for content creators and moderators going forward.

Updated on September 18, 2022

Comments

  • Jarek
    Jarek almost 2 years

    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.

    • Ludwig Schulze
      Ludwig Schulze almost 11 years
      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.
    • pabouk - Ukraine stay strong
      pabouk - Ukraine stay strong almost 11 years
      @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.
    • Jarek
      Jarek almost 11 years
      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.
    • stonux
      stonux almost 5 years
      For ripping CDs into FLAC files, use abcde ( = a better cd extractor )