Closed diffuse closed 2 years ago
Thanks! I merged this as 77e23ef330ad986a309e40c785ea521d3295e548.
but it is also worth noting that this method of bit shifting does not generate the same predefined masks that are detailed by the spec
Yeah, I guess the proper solution would be to allow specifying the channel mask, instead of making assumptions about it. But that would be a more invasive change.
Thank you to everyone involved in creating this awesome library!
I noticed that when creating a spec with
channels
> 32, an overflow occurs due to bit-shifting past the limits of theu32
type when creating the channel mask forWAVEFORMATEXTENSIBLE
mode. Here is a minimal example to reproduce the behavior:After researching the spec, it mentions that:
It also mentions that:
Since there are 18 predefined channel locations, I clamped the
channels
param to 0-18 to both ignore channels that don't have a corresponding mask bit, and to avoid writing to reserved bits.I opened an issue for this, #60, but it is also worth noting that this method of bit shifting does not generate the same predefined masks that are detailed by the spec. I'm not sure if this was intentional, but I left this behavior in up to 18 channels to preserve this choice.