[flac-dev] A couple of questions about channel mapping

lvqcl lvqcl.mail at gmail.com
Tue Jul 21 14:30:20 PDT 2015


Martin Leese wrote:

> I am also puzzled why anyone would want
> FLAC to reject a valid WAVE-EX file.


> The FLAC spec at:
>     https://xiph.org/flac/format.html
>
> states:
> Again, since a decoder may start decoding at an arbitrary frame in the
> stream, each frame header must contain some basic information about
> the stream because the decoder may not have access to the STREAMINFO
> metadata block at the start of the stream. This information includes
> sample rate, bits per sample, number of channels, etc.
>
> So, for a FLAC file to be streamable then the
> four "Channel assignment" bits in
> FRAME_HEADER must actually repeat the
> number of channels (initially specified in the
> STREAMINFO block).  The "Channel
> assignment" bits in FRAME_HEADER also
> contain the Channel assignment and, when
> these two uses of the same four bits are in
> conflict, a different channel assignment can
> be specified in the FLAC tag
> WAVEFORMATEXTENSIBLE_CHANNEL_MASK.
> (If the two uses of the "Channel assignment"
> bits in FRAME_HEADER do not conflict then
> the FLAC tag serves no purpose.)

If a decoder may not have access to STREAMINFO block then
it also cannot read VORBIS_COMMENT block, so it cannot read
WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag and will decode
a FLAC stream using the default (incorrect) channel assignment.
So the files that have non-default channel assignment are probably
not Subset compatible.
IMHO it's necessary at least to warn a user about it.


More information about the flac-dev mailing list