[flac-dev] Wrong warning in encoder for 24bits WAV

lvqcl lvqcl.mail at gmail.com
Thu Mar 20 08:45:20 PDT 2014


Olivier Tristan wrote:

> I've just faced a wrong warning trying to encode a 24 bits WAV file
>
> if(wFormatTag == 1) {
>                  if(bps != 8 && bps != 16) {
>                      if(bps == 24 || bps == 32) {
>                          /* let these slide with a warning since they're
> unambiguous */
>                          flac__utils_printf(stderr, 1, "%s: WARNING:
> legacy WAVE file has format type %u but bits-per-sample=%u\n",
> e->inbasefilename, (unsigned)wFormatTag, bps);
>
> AFAIK only 32bits file require a format of 3 while it's fine for 8, 16
> and 24bits

FLAC expects wFormatTag == 0xFFFE when bitdepth is not 8 or 16.

See http://msdn.microsoft.com/en-us/library/windows/desktop/dd757713.aspx

"If wFormatTag is WAVE_FORMAT_PCM, then wBitsPerSample should be equal to 8 or 16.
[...]
If wFormatTag is WAVE_FORMAT_EXTENSIBLE, this value can be any integer multiple of 8."


More information about the flac-dev mailing list