Closed notnot closed 3 years ago
Hi @notnot! Thanks for idea+snippet and also for your other issue https://github.com/g3n/engine/issues/245
Listing all devices requires the OpenAl extension ALC_ENUMERATE_ALL_EXT
which is potentially not supported on some systems, so we will hold off adding this requirement.
This issue will be a good reference in case we decide to implement this in the future.
Thanks again!
I'm getting ready to do some OpenAL based work and found this Go binding for it. My first experiment was to implement device enumeration. It turns out that with the current code, only the first device name is found, if there is more than a single device available. It turns out that al.CtxGetString(dev, al.AllDevicesSpecifier) goes wrong because the string that the C library returns in this case can't be parsed well by C.GoString(), because the string can actually return multiple null terminated strings, and ends with an extra null to indicate the end of the list of names. I have come up with this function that avoids this problem:
Maybe good to include it to your package?