[flac-dev] warning that legacy WAVE file has format type 1 but bits-per-sample is 24

Mark H. David mhd at yv.org
Fri May 26 23:20:00 UTC 2017


Thank you for writing and pointing out that one can have WAVE files
without getting the warning, and that your library does it.

I found out Goldwave (Windows software) writes 24-bit WAVE files that
do not get the warning. (Good for them!)

However, the flac executable from the flac reference software
apparently produces WAVE files that do get the warning.

Example annotated log:

Encode a 24-bit WAVE file (produced by Goldwave) into a FLAC file:

    $ flac -V junk-24.wav 

    flac 1.3.2
    Copyright (C) 2000-2009  Josh Coalson, 2011-2016  Xiph.Org Foundation
    flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
    welcome to redistribute it under certain conditions.  Type `flac' for details.

    junk-24.wav: Verify OK, wrote 64836 bytes, ratio=0.001


Decode the FLAC file back into a WAVE file:

    $ flac --decode --output-name=junk-24-back-out.wav junk-24.flac 

    flac 1.3.2
    Copyright (C) 2000-2009  Josh Coalson, 2011-2016  Xiph.Org Foundation
    flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
    welcome to redistribute it under certain conditions.  Type `flac' for details.

    junk-24.flac: done


Encode the resulting WAVE file into a FLAC file:

    $ flac -V junk-24-back-out.wav 

    flac 1.3.2
    Copyright (C) 2000-2009  Josh Coalson, 2011-2016  Xiph.Org Foundation
    flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
    welcome to redistribute it under certain conditions.  Type `flac' for details.

    junk-24-back-out.wav: WARNING: legacy WAVE file has format type 1 but bits-per-sample=24
    junk-24-back-out.wav: Verify OK, wrote 64792 bytes, ratio=0.001

Notice the warning was given only for the WAVE file produced by the
flac reference executable.

Should I file a bug for this?

Thanks,

Mark

----- Original message -----
From: Erik de Castro Lopo <mle+la at mega-nerd.com>
To: flac-dev at xiph.org
Subject: Re: [flac-dev] warning that legacy WAVE file has format type 1 but bits-per-sample is 24
Date: Sat, 27 May 2017 08:40:24 +1000

Mark H. David wrote:

> I'm new at this and trying to understand it. Can someone explain?\

You are correct. With a wFormatTag of 1, the bist per sample should be
either 8 or 16 (according to the Microsoft specs). 

> Also, a related but more practical question: is there *any* way to
> create a 24- or 32-bits-per-sample WAVE file without getting this
> warning when flac tries to encode it?

Yes there is. To avoid this wanring the it should have a WAVE_FORMATEXTENSIBLE
wFormatTag. Its trivally easy to convert your legacy format file to
WAVEX using the sndfile-convert program that is part of

    https://mega-nerd.com/libsndfile/

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
flac-dev mailing list
flac-dev at xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


More information about the flac-dev mailing list