[openal] Small HRTF SOFA reader lib

Chris Robinson chris.kcat at gmail.com
Sun Dec 4 09:06:25 EST 2016

On 12/04/2016 03:00 AM, Christian Hoene wrote:
> currently, we are writing a small library to read HRTF SOFA files.
> <https://github.com/choene/libmysofa> https://github.com/choene/libmysofa
> It is intended for embedded devices or mobiles that have a small (code)
> memory footprint. Of course, it might be useful for OpenAL, too.
> Because you do not need the hdf5 and netcdf libs.


This looks interesting. Especially if it doesn't have any external 

> It is not yet fully finished but I though it is time to collect feedback so
> that I can enhance it.
> If you have same spare time, please let me know on what to change to make it
> useful for you guys…

I can't comment too much on the code, since I'm not familiar with the 
HDF5 format or how SOFA files are actually put together. But I'll offer 
what I can.

First, in regards to mysofa.h, it's a good idea to prefix public 
functions and types to help avoid conflicts in other code. In 
particular, the HRTF_ATTRIBUTE and HRTF structs should have MYSOFA_ or 
something prepended to them. I also see that the __cplusplus/extern "C" 
stuff is commented out, but that would be needed to include it in C++ code.

For CMakeLists.txt, I see it's forcing a set of CFLAGS. Forcing -O0 -g 
should be unnecessary since that's implicit with CMake's Debug build 
type. -fno-omit-frame-pointer shouldn't be needed since it's only ever 
implicitly enabled when it doesn't interfere with debugging, and 
requires an explicit -fomit-frame-pointer otherwise.

For the remaining flags, you should probably use CheckCCompilerFlag to 
ensure each individual one is available before adding it. That will help 
for compatibility with other compilers, like MSVC.

If I get some time, I'll try to look at it more.

More information about the openal mailing list