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

Feature: Channel bitmasks #657

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

iluvcapra
Copy link
Contributor

Create a channel bitmask mechanism to allow sources to tell their consumers how their channels may map to speakers.

@iluvcapra iluvcapra marked this pull request as ready for review December 10, 2024 05:47
@iluvcapra iluvcapra mentioned this pull request Dec 10, 2024
@dvdsk
Copy link
Collaborator

dvdsk commented Dec 10, 2024

Might need an example since I do not completely get how this will work.

Is the idea that decoders are going to implement the new trait? In that case: https://docs.rs/symphonia-core/0.5.4/symphonia_core/codecs/struct.CodecParameters.html#structfield.channel_layout might be relevant. This matches the order assumed by channelcountconverter. I do not know what the other decoders do...

@iluvcapra
Copy link
Contributor Author

Oh good, I was looking for a file source that made this information available.

Wave files should make this available if they have > 2 channels, and the channel bitmaps are based on what Wave uses, but Hound doesn't seem to make this information available. I see what struct would have it and they just don't have a slot for it.

@iluvcapra
Copy link
Contributor Author

In fact this works almost exactly like symphonia's Channels type, I've just defined more values.
https://docs.rs/symphonia-core/0.5.4/src/symphonia_core/audio.rs.html#29-90

@PetrGlad
Copy link
Collaborator

PetrGlad commented Dec 11, 2024

Channel name mapping (name->channel_number) can be part of the stream format (it's metadata), so filters can use it if they need. We may require that filters pass it through. Just saying...

@iluvcapra
Copy link
Contributor Author

Channel name mapping (name->channel_number) can be part of the stream format (it's metadata), so filters can use it if they need. We may require that filters pass it through. Just saying...

I'd see this PR as "transitional" but yes channel_bitmask() needs to be part of trait Source, and should be, it's very necessary for working with multichannel audio.

@dvdsk
Copy link
Collaborator

dvdsk commented Dec 13, 2024

I'd see this PR as "transitional" but yes channel_bitmask() needs to be part of trait Source, and should be, it's very necessary for working with multichannel audio.

I'm okay with that, is there a default implementation you could give Source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants