go-gl / gl

Go bindings for OpenGL (generated via glow)
MIT License
1.06k stars 72 forks source link

openal binding? #127

Closed Broyojo closed 3 years ago

Broyojo commented 3 years ago

Is there an openAL binding in the works or does one already exist that works with this binding?

UserAB1236872 commented 3 years ago

OpenAL isn't really related to OpenGL and would be out of scope with the github org. Long ago I wrote an AL wrapper for Go but was never really happy with it, it's actually not very hard on a technical level if you read the documentation and know a little CGo. It's significantly easier than writing a GL wrapper because there's not a huge amount of version nonsense that requires code generation.

The only obnoxious thing to get right is properly representing a struct for a wav file or similar because of the endianness shifting and padding. Audio file/codec decoding will be the real challenge, but that's not an OpenAL thing that's just a sound format thing.

Also keep in mind OpenAL is a very, very, very thin wrapper over your computer's audio interface and doesn't really provide much in the way of utilities for things like positional audio you may need. It's much more lightweight than GL in that respect, even with a wrapper provided you'd need to do audio blending/muxing/positioning/modulation on your own.

There really should be absolutely no reason why any given random OpenAL binding wouldn't work with go-gl since they're completely different libraries and drivers.