Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsndfile surround support #693

Open
gavv opened this issue Feb 9, 2024 · 4 comments
Open

libsndfile surround support #693

gavv opened this issue Feb 9, 2024 · 4 comments

Comments

@gavv
Copy link
Member

gavv commented Feb 9, 2024

Issue to track channel orders and masks of formats supported by libsndfile.

https://libsndfile.github.io/libsndfile/api.html

Columns:

  • Order - in which order enabled surround channels are packed
    • static = order is predefined by spec
    • dynamic = order is stored in file in some format
    • = unspecified or unsupported (e.g. mono-only)
  • Mask - what mask of enabled channels corresponds to every channel count
    • 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)
  • CHANNEL_MAP_INFO - whether sndfile can provide channel info for this format
Format Order Mask Link CHANNEL_MAP_INFO
SF_FORMAT_WAV
SF_FORMAT_WAVEX static dynamic doc yes
SF_FORMAT_AIFF dynamic dynamic doc yes
SF_FORMAT_AU
SF_FORMAT_RAW
SF_FORMAT_PAF
SF_FORMAT_SVX
SF_FORMAT_NIST
SF_FORMAT_VOC
SF_FORMAT_IRCAM
SF_FORMAT_W64
SF_FORMAT_MAT4
SF_FORMAT_MAT5
SF_FORMAT_PVF
SF_FORMAT_XI
SF_FORMAT_HTK
SF_FORMAT_SDS
SF_FORMAT_AVR
SF_FORMAT_SD2
SF_FORMAT_FLAC static static doc no
SF_FORMAT_CAF dynamic dynamic doc yes
SF_FORMAT_WVE
SF_FORMAT_OGG / OPUS static static doc no
SF_FORMAT_OGG / PCM static static doc no
SF_FORMAT_OGG / SPEEX
SF_FORMAT_OGG / VORBIS static static doc no
SF_FORMAT_MPC2K
SF_FORMAT_RF64 static dynamic yes
SF_FORMAT_MPEG
@gavv gavv added this to Frontlog in kanban board Feb 9, 2024
@gavv gavv changed the title libsndfile surround channel orders libsndfile surround support Feb 9, 2024
@gavv
Copy link
Member Author

gavv commented Feb 9, 2024

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.

@gavv gavv moved this from Frontlog to In work in kanban board Feb 10, 2024
@gavv
Copy link
Member Author

gavv commented Apr 26, 2024

@gavv
Copy link
Member Author

gavv commented Apr 26, 2024

@gavv
Copy link
Member Author

gavv commented Apr 26, 2024

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.

@gavv gavv moved this from In work to Frontlog in kanban board Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant