FLAC encoding of WAV fails with error of unsupported format type 3

Whenever I purchase music from Bandcamp, SoundCloud, or other music sites that offer uncompressed, full-quality downloads (I can’t bring myself to download anything but original or lossless music files), I will always download the original WAV if it is offered. I prefer to keep the original copy around just in case, but usually I will put that on external storage, and use FLAC compression for actual listening (see my post comparing FLAC compression levels, if you’re interested).

Typically, my workflow for getting songs/albums ready is:

  • Purchase and download the full-quality WAV files
  • Rename them all according to my naming conventions
  • Batch convert them to FLAC using the command line (below)
  • Add in all the tags using EasyTag
  • Standardise the album artwork
  • Add the FLAC files to my playlists on my computers and audio server
  • Batch convert the FLACs to OGG Vorbis using a flac2all command (below) for my mobile and other devices with limited storage

It takes some time, but it’s something that I only have to do once per album, and it’s worth it for someone like me (read “OCD”). 😉 For good measure, here are the commands that I run:

Batch converting files from WAV to FLAC:
find music/wavs/$ARTIST/$ALBUM/ -iname '*.wav' -exec flac -3 {} \;
obviously replacing $ARTIST and $ALBUM with the name of the artist and album, respectively.

Batch converting files from FLAC to OGG using flac2all:
python2 flac2all_v3.38.py vorbis ./music/flac/ -v 'quality=7' -c -o ./music/ogg/

By the way, flac2all is awesome because it copies the tags and the album art as well. That’s a huge time saver for me.

Normally this process goes smoothly, and I’m on my way to enjoying my new music rather quickly. However, I recently downloaded some WAVs from SoundCloud and couldn’t figure out why I was coming up with fewer FLACs than WAVs after converting. I looked back through the output from the command, and saw the following error message on some of the track conversions:

05-Time Goes By.wav: ERROR: unsupported format type 3

That was a rather nebulous and obtuse error message, so I decided to investigate a file that worked versus these ones that didn’t:

File that failed:
$ file vexento/02-inspiration/05-Time\ Goes\ By.wav
RIFF (little-endian) data, WAVE audio, stereo 44100 Hz

File that succeeded:
$ file vexento/02-inspiration/04-Riot.wav
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz

The differences are that the working files indicated “Microsoft PCM” and “16 bit.” The fix for the problem was rather simple, actually. I used Audacity (which is a fantastic piece of cross-platform, open-source software for audio editing), and just re-exported the tracks that were failing. Basically, open the file in Audacity, make no edits, and just go to File –> Export –> “Wav (Microsoft) signed 16 bit PCM”, which you can see in the screenshot below:

Using Audacity to fix FLAC to WAV unsupported format 3
Click to enlarge

Just like that, the problem was gone! Also, I noticed that the file size changed substantially. I’m used to a WAV being about 10MiB for every minute of audio. Before re-exporting these files, they were approximately 20MiB for every minute. So, this track went from ~80MiB to ~40MiB. 🙂

Hope that helps!

Cheers,
Zach

P.S. By the way, Vexento (the artist who released the tracks mentioned here) is amazingly fun, and I recommend that everyone give him a chance. He’s a young Norwegian guy (actually named Alexander Hansen) who creates a wide array of electronic music. Two tracks (that are very different from one another) that I completely adore are Trippy Love (upbeat and fun), and Peace (calming yet cinematic).

6 comments

Skip to comment form

    • Arnvidr on Friday, 20 May 2016 at 01:46
    • Reply

    No need to waste space on downloading the WAV files from bandcamp. FLAC is a lossless format after all, so if you want them, you can just decode the FLAC files to WAV to have the originals. 🙂

      • Zach on Friday, 20 May 2016 at 11:04
        Author
      • Reply

      I partly agree with you on that one. I certainly can’t argue that FLAC is lossless, and I can decode from the FLAC to the original WAV anyway. I grab the WAVs and convert them with a specific compression level, which again may be an unnecessary step seeing as it is lossless. My previous post about compression levels and decoding time / processing power indicates that it may be negligible, but alas, I digress… Ultimately, I see your point, though. 🙂

      Thanks for the comment!

        • Arnvidr on Friday, 20 May 2016 at 15:39
        • Reply

        Not going to argue with your process, as mine is much worse, just on what you download 🙂

        Myself, I download FLAC, save the downloaded archive, decode the FLACs to WAV, and then re-encode to FLAC for my own archives, just to get everything exactly as I want it. I have built up quite the featureful python script over the years to handle originally the digitalisation of my cd collection, and later fitting anything bought online into my music collection. Storage space waste galore. But rarely any WAV files archived anywhere.

          • Zach on Friday, 20 May 2016 at 15:40
            Author
          • Reply

          Likewise, I won’t argue with your process. It’s funny the routines into which we get ourselves, and how hard it becomes to break from them even when logic dictates we should. 🙂

          Cheers,
          Zach

    • Henry on Thursday, 26 May 2016 at 18:29
    • Reply

    As wav is an uncompressed file format the filesize shouldn’t have changed that dramatically from being resaved via audacity. I suspect the original file may have been a higher bit rate.

    Maybe 24 bit and sampled at 96kHz or some variation of that. It is actually fairly common now to find files with the higher bitrate/sampling.

      • Zach on Thursday, 26 May 2016 at 22:21
        Author
      • Reply

      Thanks for your input, Henry. I don’t think that they were 24/96 or anything like that. I have WAV files that actually are 24/96, and they didn’t cause this problem when converting into FLAC. Audacity shows the bitrate and such when the file is opened. These were standard 44.1KHz WAV files, so I’m not really sure why the files were that much larger before re-saving them. I’m certainly open to further investigation if you have any suggestions for delving more deeply into it. 🙂

      Cheers,
      Zach

Leave a Reply

Your email address will not be published.