[flac-dev] [PATCH] for flac/decode.c
Brian Willoughby
brianw at audiobanshee.com
Sun Dec 14 22:39:04 PST 2014
On Dec 14, 2014, at 1:14 AM, Erik de Castro Lopo <mle+la at mega-nerd.com> wrote:
> lvqcl wrote:
>> Also, I have a question.
>>
>> Currently flac complains about 24-bit .wav files if they have
>> old WAVEFORMATEX header and not 'proper' WAVEFORMATEXTENSIBLE
>> header. However it writes such files itself.
>>
>> Is it better to fix this so it decodes 24-bit .flac files to .wav
>> files with WAVEFORMATEXTENSIBLE header? Or is it better to leave
>> things as is (for better compatibility with old programs)?
>
> That's a good question. I have no idea how to answer that.
I've never quite understood why FLAC acts this way. I use AIFF more than WAVE, so I largely ignored it.
My vague recollection is that there were historical problems with the specification for WAVE, such that different programs had different ideas about what was a valid WAVE file. Things like 24-bit, which were not used much, if at all, in the early days of WAVE, were not officially part of the spec. I always assumed, or even remembered discussions, that FLAC does what it does for maximum compatibility with existing programs.
We probably need some serious research into other programs and their treatment of WAVE. What can be read, and what is written by other software (and firmware). Ideally, FLAC would accept as wide as possible of a range of 'fmt ' chunks, while writing the most compatible variation.
> Maye what's needed is (another) command line flag.
Depending upon whether we find "one" official standard, or multiple, a command line flag might be useful to select the less common standards for those who need them.
Of course, it's certainly useful to have a command-line option to suppress the warning, but I thought there already was one.
I mentioned earlier that --keep-foreign-metadata should preserve the 'fmt ' chunk along with the rest. But I think preserving the original is a different topic than what to write when creating a "new" WAVE file from FLAC audio.
Keep in mind that it's possible to decode to WAVE after encoding from AIFF, or the reverse. So in many cases there is no original to preserve. I've even used FLAC as a dirty way to convert between AIFF and WAVE when I didn't have any other tools (since I almost always have or need a FLAC version of an audio file anyway).
Brian
More information about the flac-dev
mailing list