Open gavv opened 9 months ago
libsndfile has SFC_GET_CHANNEL_MAP_INFO
and SFC_SET_CHANNEL_MAP_INFO
, to get/set array of enabled channels, in order as they're packed.
The question is whether these commands are available for all formats.
I'll add a column for its availability to the table.
I've updated the table.
Conclusions:
Most formats don't specify channel order. For them, let's just SMPTE by default, and make it configurable in future.
Some formats have predefined channel orders, and some dynamic (i.e. described as meta-info in audio file).
Luckily, for all formats with dynamic order libsndfile seems to support CHANNEL_MAP_INFO. For those formats we can dynamically map file order to our order.
For some formats with static order libsndfile does not support CHANNEL_MAP_INFO. However, for such formats we can manually implement mapping of channel count to channel mask & order according to their spec.
Issue to track channel orders and masks of formats supported by libsndfile.
https://libsndfile.github.io/libsndfile/api.html
Columns:
static
= order is predefined by specdynamic
= order is stored in file in some format—
= unspecified or unsupported (e.g. mono-only)static
= there is predefined channel mask for each channel count (like in FLAC)dynamic
= mask is stored in file in some format (like in WAVES and AIFF)—
= unspecified or unsupported (e.g. mono-only)