HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: daodaodai on 2021-07-17 15:45:37

Title: channel assignment - what's the pattern/tag for it?
Post by: daodaodai on 2021-07-17 15:45:37
Hello there

I have some multi-channel files in .flac (and some in .wav).

foobar can show the channel assignment beautifully - in the example I attached below, it shows "5: FL FR FC BL BR. But how can I get it shown in the column field? For that I'd think I need to get the right pattern.

I have managed to get it to show the channel count using the %Channels% pattern, but so far I failed to find the right one for channel assignment. It's also useful to know cos I can have my DAW to show this info once I know what tag/pattern to use.

I have searched https://xiph.org/flac/format.html but failed. I am new to this so my question probably is common sense for the experts.

thx for your time on this.
Title: Re: channel assignment - what's the pattern/tag for it?
Post by: daodaodai on 2021-07-17 21:52:04
Hello, it's me again. Cant edit the post so I am adding a reply here:

after loads of researching I hit this page: https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference

I tried $info(name) and can successfully get things like 'codec', 'bitrate' displayed as columns, but $info(channel_mode), $info(tagtype) fail to show up.
Is there anything broken here? Or is it something I got wrong?

Thanks
Title: Re: channel assignment - what's the pattern/tag for it?
Post by: kode54 on 2021-07-18 01:15:28
Channel mode should probably show something describing the channels, but tagtype will always be blank for any formats which do not use the player's built in ID3v1/ID3v2/APEv2 tag readers. FLAC has its own tags, and does not describe what format they are in the info box, because there should only be one possible tag format.
Title: Re: channel assignment - what's the pattern/tag for it?
Post by: danadam on 2021-07-18 03:38:00
I have searched https://xiph.org/flac/format.html but failed.
It probably won't help with foobar, but the channel layout in FLAC is static, i.e., for each channels number there is one arbitrary layout, see "Channel assignment" in FRAME_HEADER ( https://xiph.org/flac/format.html#frame_header ):
Quote
Where defined, the channel order follows SMPTE/ITU-R recommendations. The assignments are as follows:
[...]
  • 3 channels: left, right, center
  • 4 channels: front left, front right, back left, back right
  • 5 channels: front left, front right, front center, back/surround left, back/surround right
  • 6 channels: front left, front right, front center, LFE, back/surround left, back/surround right
  • 7 channels: front left, front right, front center, LFE, back center, side left, side right
  • 8 channels: front left, front right, front center, LFE, back left, back right, side left, side right
Title: Re: channel assignment - what's the pattern/tag for it?
Post by: Rollin on 2021-07-18 11:45:43
the channel layout in FLAC is static, i.e., for each channels number there is one arbitrary layout
Actually, no. Because FLAC does support WAVEFORMATEXTENSIBLE_CHANNEL_MASK (not mentioned in specification for reasons unknown, but mentioned in official change log). And foobar2000 does support it for FLAC files too.

$info(channel_mode) in foobar2000 seems not working as it should.
Title: Re: channel assignment - what's the pattern/tag for it?
Post by: danadam on 2021-07-18 14:29:21
Actually, no. Because FLAC does support WAVEFORMATEXTENSIBLE_CHANNEL_MASK
Hm... good to know.
https://xiph.org/flac/changelog.html#flac_1_1_3
Quote
Now properly supports AIFF and 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.
(plus some fixes in newer versions)
(not mentioned in specification for reasons unknown
Some discussions about that but evidently without conclusions:
http://lists.xiph.org/pipermail/flac-dev/2015-July/005525.html
https://sourceforge.net/p/flac/bugs/430/