Martin Leese
2015-Jul-15 03:05 UTC
[flac-dev] WAVEFORMATEXTENSIBLE_CHANNEL_MASK is not described
lvqcl wrote: ...> From FLAC 1.2.1 documentation: > > 0000-0111 : (number of independent channels)-1. Where defined, the channel > order follows SMPTE/ITU-R recommendations. The assignments are as follows: > 1 channel: mono > 2 channels: left, right > 3 channels: left, right, center > 4 channels: left, right, back left, back right > 5 channels: left, right, center, back/surround left, back/surround right > 6 channels: left, right, center, LFE, back/surround left, back/surround > right > 7 channels: not defined > 8 channels: not defined > > It was more obvious that "where defined" means 1-6 channels, and 7 and > 8-channel > files have undefined channel assignment. Now all possible numbers of > channels have > defined channel map, so the text should be (IMHO): > > 0000-0111 : (number of independent channels)-1. The channel order follows > SMPTE/ITU-R recommendations. The assignments are as follows:Note that the channel order may not be defined. An example of this is in the Microsoft documentation defining WAVEFORMATEXTENSIBLE. The final example is titled "Multiple mono streams (no speaker location)", and has a (valid) channel mask of zero (dwChannelMask = 0). Also note that in the changelog at: https://xiph.org/flac/changelog.html it states: Now properly supports ... WAVEFORMATEXTENSIBLE multichannel input, performing necessary channel reordering both for encoding and decoding. WAVEFORMATEXTENSIBLE channel mask is also saved to a tag on encoding and restored on decoding for situations when there is no natural mapping to FLAC channel assignments. So the WAVEFORMATEXTENSIBLE channel mask is saved ONLY when the channel order does not follow SMPTE/ITU-R recommendations. Having channel assignments in two different places is bad practice. In the FLAC spec there is "1011-1111 : reserved". Why not specify one of the reserved codes to mean "channel assignment is specified in the WAVEFORMATEXTENSIBLE channel mask; go look there". The problem is how to now specify the number of channels. Regards, Martin -- Martin J Leese E-mail: martin.leese stanfordalumni.org Web: http://members.tripod.com/martin_leese/
Martin Leese wrote:>> It was more obvious that "where defined" means 1-6 channels, and 7 and >> 8-channel >> files have undefined channel assignment. Now all possible numbers of >> channels have >> defined channel map, so the text should be (IMHO): >> >> 0000-0111 : (number of independent channels)-1. The channel order follows >> SMPTE/ITU-R recommendations. The assignments are as follows: > > Note that the channel order may not be defined.IMHO it doesn't matter in this place of documentation (which describes default channel assignments for FLAC).> So the WAVEFORMATEXTENSIBLE channel > mask is saved ONLY when the channel order > does not follow SMPTE/ITU-R recommendations.Not quite true. I created two stereo (FL+FR) 24-bit wav files (one with WAVEFORMATEX header, the other with WAVEFORMATEXTENSIBLE header), and encoded them to FLAC. And FLAC creates WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag for the 2nd file (tested on FLAC 1.3.1, 1.2.1, 1.1.4).> Having channel assignments in two different > places is bad practice. In the FLAC spec there > is "1011-1111 : reserved". Why not specify one > of the reserved codes to mean "channel > assignment is specified in the > WAVEFORMATEXTENSIBLE channel mask; go > look there". The problem is how to now specify > the number of channels.The channel mask implicitly contains the number of channels; but such files probably won't be compatible with all existing decoders. What's better: a sound with incorrect channel assignment or no sound at all?