Mark H. David
2017-May-26 20:36 UTC
[flac-dev] warning that legacy WAVE file has format type 1 but bits-per-sample is 24
Hello, I've tried encoding a FLAC file from a WAVE file saved with 24-bits-per-sample, using the flac executable. I get this warning: WARNING: legacy WAVE file has format type 1 but bits-per-sample=24 The code is currently here on line 373: src/flac/encode.c where the comment says let these slide with a warning since they're unambiguous I do not really understand the warning when I try to break it down. First, *legacy* WAVE file -- what makes this a "legacy" WAVE file? Second, format type 1 What is that exactly? In the source code I see "format type" is referred to as "format tag", since the variable name is "wFormatTag". Is this what's referred to in this reference http://soundfile.sapp.org/doc/WaveFormat/ as AudioFormat There it says 1 for PCM Is there something about PCM format that implies either 8- or 16-bits-per-second? I'm new at this and trying to understand it. Can someone explain? 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? Thanks, Mark
Erik de Castro Lopo
2017-May-26 22:40 UTC
[flac-dev] warning that legacy WAVE file has format type 1 but bits-per-sample is 24
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/
Mark H. David
2017-May-26 23:20 UTC
[flac-dev] warning that legacy WAVE file has format type 1 but bits-per-sample is 24
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